summaryrefslogtreecommitdiff
path: root/block.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 /block.c
parent92bc50a5ad7fbc9a0bd17240eaea5027a100ca79 (diff)
downloadqemu-f6186f49e2c98d91f22027d8c62996df4fcf3f92.tar.gz
qemu-f6186f49e2c98d91f22027d8c62996df4fcf3f92.tar.bz2
qemu-f6186f49e2c98d91f22027d8c62996df4fcf3f92.zip
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 'block.c')
-rw-r--r--block.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/block.c b/block.c
index d86efad867..beea0274f8 100644
--- a/block.c
+++ b/block.c
@@ -4647,3 +4647,22 @@ int bdrv_amend_options(BlockDriverState *bs, QEMUOptionParameter *options)
}
return bs->drv->bdrv_amend_options(bs, options);
}
+
+ExtSnapshotPerm bdrv_check_ext_snapshot(BlockDriverState *bs)
+{
+ if (bs->drv->bdrv_check_ext_snapshot) {
+ return bs->drv->bdrv_check_ext_snapshot(bs);
+ }
+
+ if (bs->file && bs->file->drv && bs->file->drv->bdrv_check_ext_snapshot) {
+ return bs->file->drv->bdrv_check_ext_snapshot(bs);
+ }
+
+ /* external snapshots are allowed by default */
+ return EXT_SNAPSHOT_ALLOWED;
+}
+
+ExtSnapshotPerm bdrv_check_ext_snapshot_forbidden(BlockDriverState *bs)
+{
+ return EXT_SNAPSHOT_FORBIDDEN;
+}