aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/blockdev.c b/blockdev.c
index f2b3b25c10..d59efd3f15 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2218,7 +2218,7 @@ void qmp_block_commit(const char *device,
/* drain all i/o before commits */
bdrv_drain_all();
- if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT, errp)) {
+ if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_COMMIT_SOURCE, errp)) {
goto out;
}
@@ -2251,6 +2251,10 @@ void qmp_block_commit(const char *device,
assert(bdrv_get_aio_context(base_bs) == aio_context);
+ if (bdrv_op_is_blocked(base_bs, BLOCK_OP_TYPE_COMMIT_TARGET, errp)) {
+ goto out;
+ }
+
/* Do not allow attempts to commit an image into itself */
if (top_bs == base_bs) {
error_setg(errp, "cannot commit an image into itself");