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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux