]> git.proxmox.com Git - mirror_qemu.git/commitdiff
blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 19 Nov 2014 14:19:43 +0000 (14:19 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 10 Dec 2014 09:25:30 +0000 (10:25 +0100)
The BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE op blocker exists but was
never used!  Let's fix that so snapshot delete can be blocked.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c

index fb9a0059c34c7365e5f1e9d4e173489ad41ce679..a7f1e09bce2515e19937cad1f41861331e1b9253 100644 (file)
@@ -1132,6 +1132,10 @@ SnapshotInfo *qmp_blockdev_snapshot_delete_internal_sync(const char *device,
     aio_context = bdrv_get_aio_context(bs);
     aio_context_acquire(aio_context);
 
+    if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE, errp)) {
+        goto out_aio_context;
+    }
+
     ret = bdrv_snapshot_find_by_id_and_name(bs, id, name, &sn, &local_err);
     if (local_err) {
         error_propagate(errp, local_err);