Blame SOURCES/0027-launch-direct-Always-use-cache-unsafe-for-the-applia.patch

022f11
From 5be3a863c57aa56677338b499c4d6774d6384c3d Mon Sep 17 00:00:00 2001
022f11
From: "Richard W.M. Jones" <rjones@redhat.com>
022f11
Date: Thu, 5 Sep 2013 18:45:24 +0100
022f11
Subject: [PATCH] launch: direct: Always use cache=unsafe for the appliance.
022f11
022f11
The code to select writeback was redundant, because current
022f11
qemu always supports cache=unsafe.
022f11
022f11
(cherry picked from commit 011c9639267f5f1bfac41e664b2c57cc12deabf8)
022f11
---
022f11
 src/launch-direct.c | 12 ++----------
022f11
 1 file changed, 2 insertions(+), 10 deletions(-)
022f11
022f11
diff --git a/src/launch-direct.c b/src/launch-direct.c
022f11
index 3866c9b..0de7c40 100644
022f11
--- a/src/launch-direct.c
022f11
+++ b/src/launch-direct.c
022f11
@@ -392,19 +392,11 @@ launch_direct (guestfs_h *g, const char *arg)
022f11
 
022f11
     /* Add the ext2 appliance drive (after all the drives). */
022f11
     if (has_appliance_drive) {
022f11
-      const char *cachemode = "";
022f11
-      if (qemu_supports (g, "cache=")) {
022f11
-        if (qemu_supports (g, "unsafe"))
022f11
-          cachemode = ",cache=unsafe";
022f11
-        else if (qemu_supports (g, "writeback"))
022f11
-          cachemode = ",cache=writeback";
022f11
-      }
022f11
-
022f11
       size_t buf2_len = strlen (appliance) + 64;
022f11
       char buf2[buf2_len];
022f11
       add_cmdline (g, "-drive");
022f11
-      snprintf (buf2, buf2_len, "file=%s,snapshot=on,id=appliance,if=%s%s",
022f11
-                appliance, virtio_scsi ? "none" : "virtio", cachemode);
022f11
+      snprintf (buf2, buf2_len, "file=%s,snapshot=on,id=appliance,if=%s",
022f11
+                appliance, virtio_scsi ? "none" : "virtio");
022f11
       add_cmdline (g, buf2);
022f11
 
022f11
       if (virtio_scsi) {
022f11
-- 
022f11
1.8.3.1
022f11