From b783e409bf17b92f4af8dc5d6bd040d0092f33e0 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Tue, 12 Jan 2010 12:55:16 +0100 Subject: block: Introduce BDRV_O_NO_BACKING If an image references a backing file that doesn't exist, qemu-img info fails to open this image. Exactly in this case the info would be valuable, though: the user might want to find out which file is missing. This patch introduces a BDRV_O_NO_BACKING flag to ignore the backing file when opening the image. qemu-img info is the first user and provides info now even if the backing file is invalid. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qemu-img.c') diff --git a/qemu-img.c b/qemu-img.c index 1d97f2ebfb..5ad88bf763 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -884,7 +884,7 @@ static int img_info(int argc, char **argv) } else { drv = NULL; } - if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { + if (bdrv_open2(bs, filename, BRDV_O_FLAGS | BDRV_O_NO_BACKING, drv) < 0) { error("Could not open '%s'", filename); } bdrv_get_format(bs, fmt_name, sizeof(fmt_name)); -- cgit v1.2.3