File 9749d94f-qemu-help.patch of Package libvirt

commit 9749d94f7b7386213ff501e01893cd16e9a2e0c4
Author: Daniel P. Berrange <berrange@redhat.com>
Date:   Tue Jul 27 11:21:10 2010 +0100

    Invert logic for checking for QEMU disk cache options
    
    QEMU has had two different syntax for disk cache options
    
     Old: on|off
     New: writeback|writethrough|none
    
    QEMU recently added another 'unsafe' option which broke the
    libvirt check. We can avoid this & future breakage, if we
    do a negative check for the old syntax, instead of a positive
    check for the new syntax
    
    * src/qemu/qemu_conf.c: Invert cache option check

Index: libvirt-0.8.1/src/qemu/qemu_conf.c
===================================================================
--- libvirt-0.8.1.orig/src/qemu/qemu_conf.c
+++ libvirt-0.8.1/src/qemu/qemu_conf.c
@@ -1150,7 +1150,8 @@ static unsigned long long qemudComputeCm
         flags |= QEMUD_CMD_FLAG_DOMID;
     if (strstr(help, "-drive")) {
         flags |= QEMUD_CMD_FLAG_DRIVE;
-        if (strstr(help, "cache=writethrough|writeback|none"))
+        if (strstr(help, "cache=") &&
+            !strstr(help, "cache=on|off"))
             flags |= QEMUD_CMD_FLAG_DRIVE_CACHE_V2;
         if (strstr(help, "format="))
             flags |= QEMUD_CMD_FLAG_DRIVE_FORMAT;
openSUSE Build Service is sponsored by