]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/qemu_conf.c: switch off cache if disk is shared and not read-only
authorDaniel Veillard <veillard@redhat.com>
Mon, 3 Nov 2008 15:58:02 +0000 (15:58 +0000)
committerDaniel Veillard <veillard@redhat.com>
Mon, 3 Nov 2008 15:58:02 +0000 (15:58 +0000)
  patch by Charles Duffy
Daniel

ChangeLog
src/qemu_conf.c

index c0e31434e9c0107f4dc23309ccdc27d70cc450fe..53adce9d4ccd3f0a8070fcef30ff02244f0d445b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Nov  3 16:54:39 CET 2008 Daniel Veillard <veillard@redhat.com>
+
+       * src/qemu_conf.c: switch off cache if disk is shared and not read-only
+         patch by Charles Duffy
+
 Mon Nov  3 16:52:12 CET 2008 Daniel Veillard <veillard@redhat.com>
 
        * src/qemu_driver.c: oops trailing blanks
index 03b14f8462d1491af77fcb1384016222226d22ad..47c407a6590e4e5f04de88f9d48727ec1d24f3e8 100644 (file)
@@ -960,13 +960,15 @@ int qemudBuildCommandLine(virConnectPtr conn,
                 break;
             }
 
-            snprintf(opt, PATH_MAX, "file=%s,if=%s,%sindex=%d%s",
+            snprintf(opt, PATH_MAX, "file=%s,if=%s,%sindex=%d%s%s",
                      disk->src ? disk->src : "", bus,
                      media ? media : "",
                      idx,
                      bootable &&
                      disk->device == VIR_DOMAIN_DISK_DEVICE_DISK
-                     ? ",boot=on" : "");
+                     ? ",boot=on" : "",
+                     disk->shared && ! disk->readonly
+                     ? ",cache=off" : "");
 
             ADD_ARG_LIT("-drive");
             ADD_ARG_LIT(opt);