From eb852011ab3c56bd1f8e9d2c7d0dfb3eb321430a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Tue, 27 Oct 2009 18:41:44 +0100 Subject: Configurable block format whitelist We have code for a quite a few block formats. While I trust that all of these formats are useful at least for some people in some circumstances, some of them are of a kind that friends don't let friends use in production. This patch provides an optional block format whitelist, default off. If a whitelist is configured with --block-drv-whitelist, QEMU proper can use only whitelisted formats. Other programs, like qemu-img, are not affected. Drivers for formats off the whitelist still participate in format probing, to ensure all programs probe exactly the same. Without that, QEMU proper would be prone to treat images with a format off the whitelist as raw when the image's format is probed. Signed-off-by: Markus Armbruster Signed-off-by: Anthony Liguori --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 109ff5c448..132fb6e068 100644 --- a/monitor.c +++ b/monitor.c @@ -596,7 +596,7 @@ static void do_change_block(Monitor *mon, const char *device, return; } if (fmt) { - drv = bdrv_find_format(fmt); + drv = bdrv_find_whitelisted_format(fmt); if (!drv) { monitor_printf(mon, "invalid format %s\n", fmt); return; -- cgit 1.4.1