[PATCH 4/9] qemu: Add arch parameter to qemuDomainMachine*()

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

 



We want the signatures to be consistent, and also we're
going to start using the additional parameter next.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_capabilities.c |  2 +-
 src/qemu/qemu_domain.c       | 27 ++++++++++++++++-----------
 src/qemu/qemu_domain.h       | 15 ++++++++++-----
 3 files changed, 27 insertions(+), 17 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 7ccfcd054d..496fa94375 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -5229,7 +5229,7 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps,
         VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_FDC);
     }
 
-    if (qemuDomainMachineHasBuiltinIDE(machine))
+    if (qemuDomainMachineHasBuiltinIDE(machine, qemuCaps->arch))
         VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_IDE);
 
     VIR_DOMAIN_CAPS_ENUM_SET(disk->bus,
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index bae49e97a4..41996583fc 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9871,7 +9871,8 @@ qemuFindAgentConfig(virDomainDefPtr def)
 
 
 bool
-qemuDomainMachineIsQ35(const char *machine)
+qemuDomainMachineIsQ35(const char *machine,
+                       const virArch arch ATTRIBUTE_UNUSED)
 {
     return (STRPREFIX(machine, "pc-q35-") ||
             STREQ(machine, "q35"));
@@ -9879,7 +9880,8 @@ qemuDomainMachineIsQ35(const char *machine)
 
 
 bool
-qemuDomainMachineIsI440FX(const char *machine)
+qemuDomainMachineIsI440FX(const char *machine,
+                          const virArch arch ATTRIBUTE_UNUSED)
 {
     return (STREQ(machine, "pc") ||
             STRPREFIX(machine, "pc-0.") ||
@@ -9890,7 +9892,8 @@ qemuDomainMachineIsI440FX(const char *machine)
 
 
 bool
-qemuDomainMachineIsS390CCW(const char *machine)
+qemuDomainMachineIsS390CCW(const char *machine,
+                           const virArch arch ATTRIBUTE_UNUSED)
 {
     return STRPREFIX(machine, "s390-ccw");
 }
@@ -9944,9 +9947,10 @@ qemuDomainMachineIsPSeries(const char *machine,
 
 
 bool
-qemuDomainMachineHasBuiltinIDE(const char *machine)
+qemuDomainMachineHasBuiltinIDE(const char *machine,
+                               const virArch arch)
 {
-    return qemuDomainMachineIsI440FX(machine) ||
+    return qemuDomainMachineIsI440FX(machine, arch) ||
         STREQ(machine, "malta") ||
         STREQ(machine, "sun4u") ||
         STREQ(machine, "g3beige");
@@ -9954,7 +9958,8 @@ qemuDomainMachineHasBuiltinIDE(const char *machine)
 
 
 bool
-qemuDomainMachineNeedsFDC(const char *machine)
+qemuDomainMachineNeedsFDC(const char *machine,
+                          const virArch arch ATTRIBUTE_UNUSED)
 {
     const char *p = STRSKIP(machine, "pc-q35-");
 
@@ -9974,21 +9979,21 @@ qemuDomainMachineNeedsFDC(const char *machine)
 bool
 qemuDomainIsQ35(const virDomainDef *def)
 {
-    return qemuDomainMachineIsQ35(def->os.machine);
+    return qemuDomainMachineIsQ35(def->os.machine, def->os.arch);
 }
 
 
 bool
 qemuDomainIsI440FX(const virDomainDef *def)
 {
-    return qemuDomainMachineIsI440FX(def->os.machine);
+    return qemuDomainMachineIsI440FX(def->os.machine, def->os.arch);
 }
 
 
 bool
 qemuDomainIsS390CCW(const virDomainDef *def)
 {
-    return qemuDomainMachineIsS390CCW(def->os.machine);
+    return qemuDomainMachineIsS390CCW(def->os.machine, def->os.arch);
 }
 
 
@@ -10046,14 +10051,14 @@ qemuDomainHasPCIeRoot(const virDomainDef *def)
 bool
 qemuDomainHasBuiltinIDE(const virDomainDef *def)
 {
-    return qemuDomainMachineHasBuiltinIDE(def->os.machine);
+    return qemuDomainMachineHasBuiltinIDE(def->os.machine, def->os.arch);
 }
 
 
 bool
 qemuDomainNeedsFDC(const virDomainDef *def)
 {
-    return qemuDomainMachineNeedsFDC(def->os.machine);
+    return qemuDomainMachineNeedsFDC(def->os.machine, def->os.arch);
 }
 
 
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 0bd4408f12..e98999a026 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -828,17 +828,22 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def,
 
 virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def);
 
-bool qemuDomainMachineIsQ35(const char *machine);
-bool qemuDomainMachineIsI440FX(const char *machine);
-bool qemuDomainMachineIsS390CCW(const char *machine);
+bool qemuDomainMachineIsQ35(const char *machine,
+                            const virArch arch);
+bool qemuDomainMachineIsI440FX(const char *machine,
+                               const virArch arch);
+bool qemuDomainMachineIsS390CCW(const char *machine,
+                                const virArch arch);
 bool qemuDomainMachineIsARMVirt(const char *machine,
                                 const virArch arch);
 bool qemuDomainMachineIsRISCVVirt(const char *machine,
                                   const virArch arch);
 bool qemuDomainMachineIsPSeries(const char *machine,
                                 const virArch arch);
-bool qemuDomainMachineHasBuiltinIDE(const char *machine);
-bool qemuDomainMachineNeedsFDC(const char *machine);
+bool qemuDomainMachineHasBuiltinIDE(const char *machine,
+                                    const virArch arch);
+bool qemuDomainMachineNeedsFDC(const char *machine,
+                               const virArch arch);
 
 bool qemuDomainIsQ35(const virDomainDef *def);
 bool qemuDomainIsI440FX(const virDomainDef *def);
-- 
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