diff options
author | Fam Zheng <famz@redhat.com> | 2013-12-16 14:45:31 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2013-12-20 16:26:16 +0100 |
commit | 20a63d2cec838c2dde4d246c4d7abe747d9b7a11 (patch) | |
tree | 636439f43d5e1703cd0d88e5187bdf40ac15bf78 /blockdev.c | |
parent | 03544a6e9ecc1be115e8a29bd929f83b467d4816 (diff) | |
download | qemu-20a63d2cec838c2dde4d246c4d7abe747d9b7a11.zip qemu-20a63d2cec838c2dde4d246c4d7abe747d9b7a11.tar.gz qemu-20a63d2cec838c2dde4d246c4d7abe747d9b7a11.tar.bz2 |
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.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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; |