]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
qemu-img-xen: Fix cow creation with raw image backing files
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 5 May 2009 14:20:50 +0000 (15:20 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 5 May 2009 14:20:50 +0000 (15:20 +0100)
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 <ian.jackson@eu.citrix.com>
qemu-img.c

index efbb9b6be85e3bfbcabae41f0d0e459c5b89e6bb..46e6351e7d4b90066b997b9dbaf9fd1bd36093a1 100644 (file)
@@ -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);