[PATCH 1/7] Use qemuDomainMachineIs helpers when adding default devices

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

 



Do not duplicate the string comparisons by writing them twice.
---
 src/qemu/qemu_domain.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 3f1fbd7..c17abbb 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1740,8 +1740,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
             addDefaultUSB = false;
             break;
         }
-        if (STRPREFIX(def->os.machine, "pc-q35") ||
-            STREQ(def->os.machine, "q35")) {
+        if (qemuDomainMachineIsQ35(def)) {
             addPCIeRoot = true;
             addImplicitSATA = true;
 
@@ -1754,11 +1753,7 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
                 addDefaultUSB = false;
             break;
         }
-        if (!STRPREFIX(def->os.machine, "pc-0.") &&
-            !STRPREFIX(def->os.machine, "pc-1.") &&
-            !STRPREFIX(def->os.machine, "pc-i440") &&
-            STRNEQ(def->os.machine, "pc") &&
-            !STRPREFIX(def->os.machine, "rhel"))
+        if (!qemuDomainMachineIsI440FX(def))
             break;
         addPCIRoot = true;
         break;
-- 
2.7.3

--
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]