summary refs log tree commit diff stats
path: root/qemu-img.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2009-11-30 16:54:15 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-03 11:45:50 -0600
commit12c09b8ce22d74f78ff50f95676cbe4f501752ae (patch)
treebec44c2ce73007642fdeba4f2019c078520c4e72 /qemu-img.c
parent702ef63f3e0ba569727a8e01db0ef2c7cbff36e9 (diff)
downloadfocaccia-qemu-12c09b8ce22d74f78ff50f95676cbe4f501752ae.tar.gz
focaccia-qemu-12c09b8ce22d74f78ff50f95676cbe4f501752ae.zip
qemu-img: There is more than one host device driver
I haven't heard yet of anyone using qemu-img to copy an image to a real floppy,
but it's a valid use case.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r--qemu-img.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qemu-img.c b/qemu-img.c
index 972843ab82..f19c6440e1 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -743,7 +743,7 @@ static int img_convert(int argc, char **argv)
             if (n > bs_offset + bs_sectors - sector_num)
                 n = bs_offset + bs_sectors - sector_num;
 
-            if (strcmp(drv->format_name, "host_device")) {
+            if (!drv->no_zero_init) {
                 /* If the output image is being created as a copy on write image,
                    assume that sectors which are unallocated in the input image
                    are present in both the output's and input's base images (no
@@ -776,7 +776,7 @@ static int img_convert(int argc, char **argv)
                    If the output is to a host device, we also write out
                    sectors that are entirely 0, since whatever data was
                    already there is garbage, not 0s. */
-                if (strcmp(drv->format_name, "host_device") == 0 || out_baseimg ||
+                if (drv->no_zero_init || out_baseimg ||
                     is_allocated_sectors(buf1, n, &n1)) {
                     if (bdrv_write(out_bs, sector_num, buf1, n1) < 0)
                         error("error while writing");