summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-26 18:25:06 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-26 18:33:37 +0100
commitfe2253088ff51b51e2586f27a9408a38655170e3 (patch)
treea4b24b0fe395a715cda5e6930adcba66715b0c5f
parent0f837ec068783a6318ba6f7490b567566bce2aa4 (diff)
downloadlibguestfs-fe2253088ff51b51e2586f27a9408a38655170e3.tar.gz
libguestfs-fe2253088ff51b51e2586f27a9408a38655170e3.tar.xz
libguestfs-fe2253088ff51b51e2586f27a9408a38655170e3.zip
appliance: Add '-drive detect-zero=on' flag if qemu supports it.
NB: The patch to implement this feature in qemu is not upstream, and may never make it upstream. However this is so useful for virt-sparsify that I decided to add this to libguestfs while we see what qemu decides to do.
-rw-r--r--src/launch-appliance.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/launch-appliance.c b/src/launch-appliance.c
index 328cd196..bad9cb70 100644
--- a/src/launch-appliance.c
+++ b/src/launch-appliance.c
@@ -942,11 +942,12 @@ qemu_drive_param (guestfs_h *g, const struct drive *drv, size_t index)
else
iface = "virtio";
- snprintf (&r[i], len-i, "%s%s%s%s,id=hd%zu,if=%s",
+ snprintf (&r[i], len-i, "%s%s%s%s%s,id=hd%zu,if=%s",
drv->readonly ? ",snapshot=on" : "",
drv->use_cache_none ? ",cache=none" : "",
drv->format ? ",format=" : "",
drv->format ? drv->format : "",
+ qemu_supports (g, "detect-zero") ? ",detect-zero=on" : "",
index,
iface);