aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-04-18 17:10:26 +0200
committerKevin Wolf <kwolf@redhat.com>2018-05-23 14:30:50 +0200
commitb15de82867975e0b4acf644b5ee36d84904b6612 (patch)
tree7d2052b01d9021df82c698827b795149bbd2f0a4 /include/block
parent5d43e86e11f488fda7956b13160e0c0105a84845 (diff)
downloadqemu-b15de82867975e0b4acf644b5ee36d84904b6612.zip
qemu-b15de82867975e0b4acf644b5ee36d84904b6612.tar.gz
qemu-b15de82867975e0b4acf644b5ee36d84904b6612.tar.bz2
job: Move pause/resume functions to Job
While we already moved the state related to job pausing to Job, the functions to do were still BlockJob only. This commit moves them over to Job. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r--include/block/blockjob.h32
-rw-r--r--include/block/blockjob_int.h7
2 files changed, 7 insertions, 32 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index b60d919..556a8f6 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -57,12 +57,6 @@ typedef struct BlockJob {
bool force;
/**
- * Set to true if the job is paused by user. Can be unpaused with the
- * block-job-resume QMP command.
- */
- bool user_paused;
-
- /**
* Set to true when the job is ready to be completed.
*/
bool ready;
@@ -248,32 +242,6 @@ void block_job_progress_set_remaining(BlockJob *job, uint64_t remaining);
BlockJobInfo *block_job_query(BlockJob *job, Error **errp);
/**
- * 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, Error **errp);
-
-/**
- * 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_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, Error **errp);
-
-/**
* block_job_user_cancel:
* @job: The job to be cancelled.
* @force: Quit a job without waiting for data to be in sync.
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
index 8937f5b..7e705ae 100644
--- a/include/block/blockjob_int.h
+++ b/include/block/blockjob_int.h
@@ -134,6 +134,13 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
void block_job_free(Job *job);
/**
+ * block_job_user_resume:
+ * Callback to be used for JobDriver.user_resume in all block jobs. Resets the
+ * iostatus when the user resumes @job.
+ */
+void block_job_user_resume(Job *job);
+
+/**
* block_job_yield:
* @job: The job that calls the function.
*