summaryrefslogtreecommitdiffstats
path: root/include/block/blockjob.h
diff options
context:
space:
mode:
authorJohn Snow2016-11-08 07:50:37 +0100
committerJeff Cody2016-11-15 04:47:34 +0100
commit5ccac6f186e4a480074880d958760c7105cf9ba8 (patch)
tree7f5f66df425b35ad18683743788ad575032cbeea /include/block/blockjob.h
parentblockjob: add .start field (diff)
downloadqemu-5ccac6f186e4a480074880d958760c7105cf9ba8.tar.gz
qemu-5ccac6f186e4a480074880d958760c7105cf9ba8.tar.xz
qemu-5ccac6f186e4a480074880d958760c7105cf9ba8.zip
blockjob: add block_job_start
Instead of automatically starting jobs at creation time via backup_start et al, we'd like to return a job object pointer that can be started manually at later point in time. For now, add the block_job_start mechanism and start the jobs automatically as we have been doing, with conversions job-by-job coming in later patches. Of note: cancellation of unstarted jobs will perform all the normal cleanup as if the job had started, particularly abort and clean. The only difference is that we will not emit any events, because the job never actually started. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1478587839-9834-5-git-send-email-jsnow@redhat.com Signed-off-by: Jeff Cody <jcody@redhat.com>
Diffstat (limited to 'include/block/blockjob.h')
-rw-r--r--include/block/blockjob.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/block/blockjob.h b/include/block/blockjob.h
index 356cacf004..1acb256223 100644
--- a/include/block/blockjob.h
+++ b/include/block/blockjob.h
@@ -189,6 +189,15 @@ void block_job_add_bdrv(BlockJob *job, BlockDriverState *bs);
void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp);
/**
+ * block_job_start:
+ * @job: A job that has not yet been started.
+ *
+ * Begins execution of a block job.
+ * Takes ownership of one reference to the job object.
+ */
+void block_job_start(BlockJob *job);
+
+/**
* block_job_cancel:
* @job: The job to be canceled.
*