commit: Support commit active layer

If active is top, it will be mirrored to base, (with block/mirror.c
code), then the image is switched when user completes the block job.

QMP documentation is updated.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Fam Zheng
2013-12-20 16:26:16 +01:00
committed by Stefan Hajnoczi
parent 03544a6e9e
commit 20a63d2cec
3 changed files with 21 additions and 4 deletions
+7 -2
View File
@@ -1820,8 +1820,13 @@ void qmp_block_commit(const char *device,
return;
}
commit_start(bs, base_bs, top_bs, speed, on_error, block_job_cb, bs,
&local_err);
if (top_bs == bs) {
commit_active_start(bs, base_bs, speed, on_error, block_job_cb,
bs, &local_err);
} else {
commit_start(bs, base_bs, top_bs, speed, on_error, block_job_cb, bs,
&local_err);
}
if (local_err != NULL) {
error_propagate(errp, local_err);
return;