aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2016-10-27 12:06:59 -0400
committerJeff Cody <jcody@redhat.com>2016-11-01 07:55:57 -0400
commit0df4ba58631772dd391314c1119863b574ebbaf9 (patch)
treee2e9931226b491f08a2845cab9b1eb7e6447d0ac /include/block
parent8254b6d9534ba6a7d078a717e777fefe75ec27b6 (diff)
Blockjobs: Internalize user_pause logic
BlockJobs will begin hiding their state in preparation for some refactorings anyway, so let's internalize the user_pause mechanism instead of leaving it to callers to correctly manage. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Message-id: 1477584421-1399-6-git-send-email-jsnow@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/blockjob.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index c031fe78cc..d31ea43116 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -379,6 +379,23 @@ void coroutine_fn block_job_pause_point(BlockJob *job);
void block_job_pause(BlockJob *job);
/**
+ * block_job_user_pause:
+ * @job: The job to be paused.
+ *
+ * Asynchronously pause the specified job.
+ * Do not allow a resume until a matching call to block_job_user_resume.
+ */
+void block_job_user_pause(BlockJob *job);
+
+/**
+ * block_job_paused:
+ * @job: The job to query.
+ *
+ * Returns true if the job is user-paused.
+ */
+bool block_job_user_paused(BlockJob *job);
+
+/**
* block_job_resume:
* @job: The job to be resumed.
*
@@ -387,6 +404,15 @@ void block_job_pause(BlockJob *job);
void block_job_resume(BlockJob *job);
/**
+ * block_job_user_resume:
+ * @job: The job to be resumed.
+ *
+ * Resume the specified job.
+ * Must be paired with a preceding block_job_user_pause.
+ */
+void block_job_user_resume(BlockJob *job);
+
+/**
* block_job_enter:
* @job: The job to enter.
*