From: Ian Jackson Date: Tue, 5 May 2009 14:20:50 +0000 (+0100) Subject: qemu-img-xen: Fix cow creation with raw image backing files X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=be598c20435f39f2d71f4b3d8d0489dd9e3af4ba;p=xenclient%2Fioemu.git qemu-img-xen: Fix cow creation with raw image backing files Previously dd if=/dev/zero of=raw_image count=100 ./qemu-img-xen create -b raw_image -f qcow2 cow_image would fail because it would attempt to autodetect the format of base_image. With this change, it works. However, ./qemu-img-xen create -b cow_image -f qcow2 cow_image_2 will now fail because we now always expect the backing file to be raw. Thanks to Xin Li and Dongxiao Xu for the bug report. Signed-off-by: Ian Jackson --- diff --git a/qemu-img.c b/qemu-img.c index efbb9b6b..46e6351e 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -199,7 +199,7 @@ static BlockDriverState *bdrv_new_open(const char *filename, if (!drv) error("Unknown file format '%s'", fmt); } else { - drv = NULL; + drv = &bdrv_raw; } if (bdrv_open2(bs, filename, BRDV_O_FLAGS, drv) < 0) { error("Could not open '%s'", filename);