summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf2021-07-09 18:41:41 +0200
committerKevin Wolf2021-07-20 13:14:45 +0200
commite5f05f8c375157211c7da625a0d3f3ccdb4957d5 (patch)
treefc5592f27a8f5b0379f82395e153ce085e91df1c /block.c
parentblock/mirror: fix active mirror dead-lock in mirror_wait_on_conflicts (diff)
downloadqemu-e5f05f8c375157211c7da625a0d3f3ccdb4957d5.tar.gz
qemu-e5f05f8c375157211c7da625a0d3f3ccdb4957d5.tar.xz
qemu-e5f05f8c375157211c7da625a0d3f3ccdb4957d5.zip
block: Add option to use driver whitelist even in tools
Currently, the block driver whitelists are only applied for the system emulator. All other binaries still give unrestricted access to all block drivers. There are use cases where this made sense because the main concern was avoiding customers running VMs on less optimised block drivers and getting bad performance. Allowing the same image format e.g. as a target for 'qemu-img convert' is not a problem then. However, if the concern is the supportability of the driver in general, either in full or when used read-write, not applying the list driver whitelist in tools doesn't help - especially since qemu-nbd and qemu-storage-daemon now give access to more or less the same operations in block drivers as running a system emulator. In order to address this, introduce a new configure option that enforces the driver whitelist in all binaries. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210709164141.254097-1-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block.c b/block.c
index be083f389e..e97ce0b1c8 100644
--- a/block.c
+++ b/block.c
@@ -6162,6 +6162,9 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs,
void bdrv_init(void)
{
+#ifdef CONFIG_BDRV_WHITELIST_TOOLS
+ use_bdrv_whitelist = 1;
+#endif
module_call_init(MODULE_INIT_BLOCK);
}