diff --git a/ChangeLog b/ChangeLog index c0e31434e9..53adce9d4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Nov 3 16:54:39 CET 2008 Daniel Veillard + + * 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 * src/qemu_driver.c: oops trailing blanks diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 03b14f8462..47c407a659 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);