aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2013-12-16 14:45:31 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-20 16:26:16 +0100
commit20a63d2cec838c2dde4d246c4d7abe747d9b7a11 (patch)
tree636439f43d5e1703cd0d88e5187bdf40ac15bf78 /blockdev.c
parent03544a6e9ecc1be115e8a29bd929f83b467d4816 (diff)
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>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/blockdev.c b/blockdev.c
index 6a85961af2..2c3242b87a 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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;