aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2014-11-19 14:19:43 +0000
committerKevin Wolf <kwolf@redhat.com>2014-12-10 10:25:30 +0100
commit0b92885420c9cf42da27c63939d388e276a7ddde (patch)
tree7c5833c214bdd1eadf3ef2bf1b561f19b4d415b2 /blockdev.c
parent4ef3982a99f9d2634588b4785c8d841605517946 (diff)
blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT_DELETE
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>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index fb9a0059c3..a7f1e09bce 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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);