[PATCH] libxl: fix domxml-to-native wrong output for qcow2 format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



e.g. for these following disk configuration in libvirt.
      <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/xen/images/001/disk0.qcow2'/>
      <target dev='hdc'/>

without this patch, it will be
    "qemu:/var/lib/xen/images/001/disk0.qcow2,hdc,w"
but it should be(if with this patch)
    "qcow2:/var/lib/xen/images/001/disk0.qcow2,hdc,w"

Signed-off-by: Bamvor Jian Zhang <bjzhang@xxxxxxxx>
---
 src/xenxs/xen_xm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/xenxs/xen_xm.c b/src/xenxs/xen_xm.c
index b2db97d..29835b4 100644
--- a/src/xenxs/xen_xm.c
+++ b/src/xenxs/xen_xm.c
@@ -1209,7 +1209,10 @@ xenFormatXMDisk(virConfValuePtr list,
                 type = "aio";
             else
                 type = virStorageFileFormatTypeToString(format);
-            virBufferAsprintf(&buf, "%s:", driver);
+            if (!STREQ(type, "qcow2"))
+                virBufferAsprintf(&buf, "%s:", driver);
+            else
+                virBufferAsprintf(&buf, "%s:", type);
             if (STREQ(driver, "tap"))
                 virBufferAsprintf(&buf, "%s:", type);
         } else {
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]