]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Use more specific prefixes
authorAndrea Bolognani <abologna@redhat.com>
Wed, 28 Nov 2018 14:04:51 +0000 (15:04 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Fri, 8 Feb 2019 15:16:10 +0000 (16:16 +0100)
While the chances of the current checks resulting in false
positives are basically zero, it's still nicer to check for
the full prefix instead of the prefix's prefix.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
src/qemu/qemu_domain.c

index 021fac15c1a9d415efa95fc54629c1c61550a385..4bc849faf4eb8ce707e84aa1d052538e9325381e 100644 (file)
@@ -9885,7 +9885,7 @@ qemuDomainIsQ35(const virDomainDef *def)
 bool
 qemuDomainMachineIsQ35(const char *machine)
 {
-    return (STRPREFIX(machine, "pc-q35") ||
+    return (STRPREFIX(machine, "pc-q35-") ||
             STREQ(machine, "q35"));
 }
 
@@ -9903,7 +9903,7 @@ qemuDomainMachineIsI440FX(const char *machine)
     return (STREQ(machine, "pc") ||
             STRPREFIX(machine, "pc-0.") ||
             STRPREFIX(machine, "pc-1.") ||
-            STRPREFIX(machine, "pc-i440") ||
+            STRPREFIX(machine, "pc-i440fx-") ||
             STRPREFIX(machine, "rhel"));
 }