aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorBenoƮt Canet <benoit@irqsave.net>2013-10-02 14:33:48 +0200
committerKevin Wolf <kwolf@redhat.com>2013-10-11 16:49:59 +0200
commitf6186f49e2c98d91f22027d8c62996df4fcf3f92 (patch)
treeeb831f18393107e9014f1bbf91931d21427afd84 /blockdev.c
parent92bc50a5ad7fbc9a0bd17240eaea5027a100ca79 (diff)
block: Add BlockDriver.bdrv_check_ext_snapshot.
This field is used by blkverify to disable external snapshots creation. It will also be used by block filters like quorum to disable external snapshot creation. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/blockdev.c b/blockdev.c
index 8c83f6f1ca..a91d5a87df 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1131,6 +1131,11 @@ static void external_snapshot_prepare(BlkTransactionState *common,
}
}
+ if (bdrv_check_ext_snapshot(state->old_bs) != EXT_SNAPSHOT_ALLOWED) {
+ error_set(errp, QERR_FEATURE_DISABLED, "snapshot");
+ return;
+ }
+
flags = state->old_bs->open_flags;
/* create new image w/backing file */