Blame SOURCES/0022-RHEL-7-All-qemu-kvm-in-RHEL-7-supports-discard-of-qc.patch

e9bfca
From 22aa6ba208a06138fb482231877992c1cd31eb4f Mon Sep 17 00:00:00 2001
151578
From: "Richard W.M. Jones" <rjones@redhat.com>
151578
Date: Wed, 27 May 2015 10:03:00 -0400
151578
Subject: [PATCH] RHEL 7: All qemu-kvm in RHEL 7 supports discard of qcow2
151578
 (RHBZ#1225467).
151578
151578
For rationale behind this, see:
151578
151578
  https://bugzilla.redhat.com/show_bug.cgi?id=1225467#c2
151578
---
151578
 lib/qemu.c | 12 ++----------
151578
 1 file changed, 2 insertions(+), 10 deletions(-)
151578
151578
diff --git a/lib/qemu.c b/lib/qemu.c
e9bfca
index 6159b5a52..1e52cf75b 100644
151578
--- a/lib/qemu.c
151578
+++ b/lib/qemu.c
e9bfca
@@ -916,10 +916,6 @@ guestfs_int_discard_possible (guestfs_h *g, struct drive *drv,
151578
    * discard option on -drive at all.
151578
    */
151578
   bool qemu15 = guestfs_int_version_ge (qemu_version, 1, 5, 0);
151578
-  /* qemu >= 1.6.  This was the first version that supported unmap on
151578
-   * qcow2 backing files.
151578
-   */
151578
-  bool qemu16 = guestfs_int_version_ge (qemu_version, 1, 6, 0);
151578
 
151578
   if (!qemu15)
151578
     NOT_SUPPORTED (g, false,
e9bfca
@@ -944,12 +940,8 @@ guestfs_int_discard_possible (guestfs_h *g, struct drive *drv,
151578
   }
151578
   else if (STREQ (drv->src.format, "raw"))
151578
     /* OK */ ;
151578
-  else if (STREQ (drv->src.format, "qcow2")) {
151578
-    if (!qemu16)
151578
-      NOT_SUPPORTED (g, false,
151578
-                     _("discard cannot be enabled on this drive: "
151578
-                       "qemu < 1.6 cannot do discard on qcow2 files"));
151578
-  }
151578
+  else if (STREQ (drv->src.format, "qcow2"))
151578
+    /* OK */ ;
151578
   else {
151578
     /* It's possible in future other formats will support discard, but
151578
      * currently (qemu 1.7) none of them do.
151578
-- 
3d5c2a
2.17.2
151578