aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2012-10-18 16:49:21 +0200
committerKevin Wolf <kwolf@redhat.com>2012-10-24 10:26:19 +0200
commitaeae883baf2377b714a41529f94905046fa058f3 (patch)
treec62538f24a70deb5abebbcca2589cdd30d375738 /blockdev.c
parent65f4632243f526958aa1f6b3911add98329c3796 (diff)
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 'blockdev.c')
-rw-r--r--blockdev.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 46e4bbd8d9..02d3e0b698 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1266,6 +1266,19 @@ void qmp_block_job_resume(const char *device, Error **errp)
block_job_resume(job);
}
+void qmp_block_job_complete(const char *device, Error **errp)
+{
+ BlockJob *job = find_block_job(device);
+
+ if (!job) {
+ error_set(errp, QERR_BLOCK_JOB_NOT_ACTIVE, device);
+ return;
+ }
+
+ trace_qmp_block_job_complete(job);
+ block_job_complete(job, errp);
+}
+
static void do_qmp_query_block_jobs_one(void *opaque, BlockDriverState *bs)
{
BlockJobInfoList **prev = opaque;