[libvirt] [PATCH 2/9] qemu: Use more specific prefixes

Andrea Bolognani abologna at redhat.com
Wed Feb 6 13:46:48 UTC 2019


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 at redhat.com>
---
 src/qemu/qemu_domain.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b6c1a0e4e5..073f5cc86c 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9880,7 +9880,7 @@ qemuDomainIsQ35(const virDomainDef *def)
 bool
 qemuDomainMachineIsQ35(const char *machine)
 {
-    return (STRPREFIX(machine, "pc-q35") ||
+    return (STRPREFIX(machine, "pc-q35-") ||
             STREQ(machine, "q35"));
 }
 
@@ -9898,7 +9898,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"));
 }
 
-- 
2.20.1




More information about the libvir-list mailing list