[libvirt] [PATCH] set cache=off on -disk line in qemu driver if <shareable/> (but not <readonly/>) is set.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As cache=off is necessary for clustering filesystems such as GFS (and such is the point of shareable, yes?), I believe this is correct behavior.

Comments?
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index 03b14f8..47c407a 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -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);
--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]