Blame SOURCES/0004-v2v-o-libvirt-Remove-cache-none-RHBZ-1837453.patch

7ed5e3
From 939d57ef4d5bcfa31e9b98104822962b89572481 Mon Sep 17 00:00:00 2001
7ed5e3
From: "Richard W.M. Jones" <rjones@redhat.com>
7ed5e3
Date: Tue, 19 May 2020 14:40:01 +0100
7ed5e3
Subject: [PATCH] v2v: -o libvirt: Remove cache=none (RHBZ#1837453).
7ed5e3
7ed5e3
Traditionally if you did live migration (KVM to KVM), you had to
7ed5e3
ensure that cache=none was set on all disks of the guest up front.
7ed5e3
This was because of quirks in how NFS works (I think the close-to-open
7ed5e3
consistency and the fact that during live migration both qemus have
7ed5e3
the file open), and we had to assume the worst case that a guest might
7ed5e3
be backed by NFS.
7ed5e3
7ed5e3
Because of this when virt-v2v converts a guest to run on KVM using
7ed5e3
libvirt it sets cache=none.
7ed5e3
7ed5e3
This is not necessary with modern qemu.  If qemu supports the
7ed5e3
drop-cache property of the file block driver, which libvirt will
7ed5e3
automatically detect for us, then libvirt live migration is able to
7ed5e3
tell qemu to drop cached data at the right time even if the backing is
7ed5e3
NFS.
7ed5e3
7ed5e3
It also had a significant performance impact.  In some synthetic
7ed5e3
benchmarks it could show 2 or 3 times slower performance.
7ed5e3
7ed5e3
Thanks: Ming Xie, Peter Krempa.
7ed5e3
(cherry picked from commit 9720f45e0cd9283739fd2a67c19e66912489dfc7)
7ed5e3
---
7ed5e3
 docs/virt-v2v-output-local.pod | 2 +-
7ed5e3
 tests/test-v2v-cdrom.expected  | 2 +-
7ed5e3
 tests/test-v2v-floppy.expected | 2 +-
7ed5e3
 tests/test-v2v-i-ova.xml       | 2 +-
7ed5e3
 v2v/create_libvirt_xml.ml      | 1 -
7ed5e3
 5 files changed, 4 insertions(+), 5 deletions(-)
7ed5e3
7ed5e3
diff --git a/docs/virt-v2v-output-local.pod b/docs/virt-v2v-output-local.pod
7ed5e3
index 38df007d..a5f155cb 100644
7ed5e3
--- a/docs/virt-v2v-output-local.pod
7ed5e3
+++ b/docs/virt-v2v-output-local.pod
7ed5e3
@@ -127,7 +127,7 @@ Edit F to change F to the pool
7ed5e3
 name.  In other words, locate the following bit of XML:
7ed5e3
 
7ed5e3
  <disk type='file' device='disk'>
7ed5e3
-   <driver name='qemu' type='raw' cache='none' />
7ed5e3
+   <driver name='qemu' type='raw' />
7ed5e3
    <source file='/var/tmp/NAME-sda' />
7ed5e3
    <target dev='hda' bus='ide' />
7ed5e3
  </disk>
7ed5e3
diff --git a/tests/test-v2v-cdrom.expected b/tests/test-v2v-cdrom.expected
7ed5e3
index e18ea6f2..34d2bf59 100644
7ed5e3
--- a/tests/test-v2v-cdrom.expected
7ed5e3
+++ b/tests/test-v2v-cdrom.expected
7ed5e3
@@ -1,5 +1,5 @@
7ed5e3
     <disk type='file' device='disk'>
7ed5e3
-      <driver name='qemu' type='raw' cache='none'/>
7ed5e3
+      <driver name='qemu' type='raw'/>
7ed5e3
       <target dev='vda' bus='virtio'/>
7ed5e3
     </disk>
7ed5e3
     <disk device='cdrom' type='file'>
7ed5e3
diff --git a/tests/test-v2v-floppy.expected b/tests/test-v2v-floppy.expected
7ed5e3
index dd74ed94..a718c21f 100644
7ed5e3
--- a/tests/test-v2v-floppy.expected
7ed5e3
+++ b/tests/test-v2v-floppy.expected
7ed5e3
@@ -1,5 +1,5 @@
7ed5e3
     <disk type='file' device='disk'>
7ed5e3
-      <driver name='qemu' type='raw' cache='none'/>
7ed5e3
+      <driver name='qemu' type='raw'/>
7ed5e3
       <target dev='vda' bus='virtio'/>
7ed5e3
     </disk>
7ed5e3
     <disk device='floppy' type='file'>
7ed5e3
diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml
7ed5e3
index 7c198283..e26f4f83 100644
7ed5e3
--- a/tests/test-v2v-i-ova.xml
7ed5e3
+++ b/tests/test-v2v-i-ova.xml
7ed5e3
@@ -22,7 +22,7 @@
7ed5e3
   <on_crash>restart</on_crash>
7ed5e3
   <devices>
7ed5e3
     <disk type='file' device='disk'>
7ed5e3
-      <driver name='qemu' type='raw' cache='none'/>
7ed5e3
+      <driver name='qemu' type='raw'/>
7ed5e3
       <source file='TestOva-sda'/>
7ed5e3
       <target dev='vda' bus='virtio'/>
7ed5e3
     </disk>
7ed5e3
diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml
7ed5e3
index 05553c4f..5a1fba0f 100644
7ed5e3
--- a/v2v/create_libvirt_xml.ml
7ed5e3
+++ b/v2v/create_libvirt_xml.ml
7ed5e3
@@ -336,7 +336,6 @@ let create_libvirt_xml ?pool source targets target_buses guestcaps
7ed5e3
           e "driver" [
7ed5e3
             "name", "qemu";
7ed5e3
             "type", t.target_format;
7ed5e3
-            "cache", "none"
7ed5e3
           ] [];
7ed5e3
           (match pool with
7ed5e3
           | None ->
7ed5e3
-- 
446330
2.27.0
7ed5e3