]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fixed default machine detection in qemuCapsParseMachineTypesStr
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Wed, 17 Oct 2012 14:48:42 +0000 (16:48 +0200)
committerEric Blake <eblake@redhat.com>
Wed, 17 Oct 2012 23:24:41 +0000 (17:24 -0600)
The machine in the last output line of <qemu-binary> -M ?
was always reported as default machine even if this wasn't the
actual default. Trivial fix.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/qemu/qemu_capabilities.c

index fb0fe5454699f2d4bcf450b5219403b6ac04b372..985d4def3ba1a3e3b930ef7125e8934aec134930 100644 (file)
@@ -284,7 +284,7 @@ qemuCapsParseMachineTypesStr(const char *output,
             goto no_memory;
 
         p = t;
-        if (!(t = strstr(p, "(default)")) && (!next || t < next))
+        if ((t = strstr(p, "(default)")) && (!next || t < next))
             defIdx = caps->nmachineTypes;
 
         if ((t = strstr(p, "(alias of ")) && (!next || t < next)) {