diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-18 16:49:21 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-10-24 10:26:19 +0200 |
commit | aeae883baf2377b714a41529f94905046fa058f3 (patch) | |
tree | c62538f24a70deb5abebbcca2589cdd30d375738 /blockjob.h | |
parent | 65f4632243f526958aa1f6b3911add98329c3796 (diff) | |
download | qemu-aeae883baf2377b714a41529f94905046fa058f3.zip qemu-aeae883baf2377b714a41529f94905046fa058f3.tar.gz qemu-aeae883baf2377b714a41529f94905046fa058f3.tar.bz2 |
block: add block-job-complete
While streaming can be dropped as soon as it progressed through the whole
image, mirroring needs to be completed manually for two reasons: 1) so that
management knows exactly when the VM switches to the target; 2) because
for other use cases such as replication, we may leave the operation running
for the whole life of the virtual machine.
Add a new block job command that manually completes background operations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockjob.h')
-rw-r--r-- | blockjob.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -41,6 +41,12 @@ typedef struct BlockJobType { /** Optional callback for job types that support setting a speed limit */ void (*set_speed)(BlockJob *job, int64_t speed, Error **errp); + + /** + * Optional callback for job types whose completion must be triggered + * manually. + */ + void (*complete)(BlockJob *job, Error **errp); } BlockJobType; /** @@ -164,6 +170,15 @@ void block_job_set_speed(BlockJob *job, int64_t speed, Error **errp); void block_job_cancel(BlockJob *job); /** + * block_job_complete: + * @job: The job to be completed. + * @errp: Error object. + * + * Asynchronously complete the specified job. + */ +void block_job_complete(BlockJob *job, Error **errp); + +/** * block_job_is_cancelled: * @job: The job being queried. * |