mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone
Blob Blame History Raw
From 1f182ed648b7cf9d4f9f9fdceeb5be69cd2be4ae Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 29 Jun 2017 23:59:15 +0100
Subject: [PATCH] lib: libvirt: Pass copyonread flag through to the libvirt XML
 (RHBZ#1466563).

We were dropping the add_drive copyonread flag when using the libvirt
backend.  This resulted in significant performance degradation (2x-3x
slower) when running virt-v2v against VMware servers.

Thanks: Kun Wei.

(cherry picked from commit d96209ef07fef3db0e411648348f1b1dcf384e70)
---
 lib/launch-libvirt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
index 0c2879d..144937b 100644
--- a/lib/launch-libvirt.c
+++ b/lib/launch-libvirt.c
@@ -1547,7 +1547,8 @@ construct_libvirt_xml_disk (guestfs_h *g,
 
       if (construct_libvirt_xml_disk_driver_qemu (g, data, drv, xo, format,
                                                   drv->cachemode ? : "writeback",
-                                                  drv->discard, false)
+                                                  drv->discard,
+                                                  drv->copyonread)
           == -1)
         return -1;
     }
-- 
2.9.4