[PATCH 8/9] qemu: Move qemuDomainSupportsPCI() to qemu_domain

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

 



The function operates on a virDomainDef and is not tied to
device address assignment in any way, so it makes more sense
for it to live along with qemuDomainIs*() and the like.

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

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 8db02f7738..f222f78654 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -10080,6 +10080,28 @@ qemuDomainNeedsFDC(const virDomainDef *def)
 }
 
 
+bool
+qemuDomainSupportsPCI(virDomainDefPtr def,
+                      virQEMUCapsPtr qemuCaps)
+{
+    if ((def->os.arch != VIR_ARCH_ARMV6L) &&
+        (def->os.arch != VIR_ARCH_ARMV7L) &&
+        (def->os.arch != VIR_ARCH_AARCH64) &&
+        !ARCH_IS_RISCV(def->os.arch))
+        return true;
+
+    if (STREQ(def->os.machine, "versatilepb"))
+        return true;
+
+    if ((qemuDomainIsARMVirt(def) ||
+         qemuDomainIsRISCVVirt(def)) &&
+        virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
+        return true;
+
+    return false;
+}
+
+
 static bool
 qemuCheckMemoryDimmConflict(const virDomainDef *def,
                             const virDomainMemoryDef *mem)
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index 89f45aeb2c..f6b124e8fd 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -847,6 +847,8 @@ bool qemuDomainHasPCIRoot(const virDomainDef *def);
 bool qemuDomainHasPCIeRoot(const virDomainDef *def);
 bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
 bool qemuDomainNeedsFDC(const virDomainDef *def);
+bool qemuDomainSupportsPCI(virDomainDefPtr def,
+                           virQEMUCapsPtr qemuCaps);
 
 int qemuDomainUpdateCurrentMemorySize(virQEMUDriverPtr driver,
                                       virDomainObjPtr vm);
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index c35ecd8585..32fdd59566 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2356,28 +2356,6 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
 }
 
 
-static bool
-qemuDomainSupportsPCI(virDomainDefPtr def,
-                      virQEMUCapsPtr qemuCaps)
-{
-    if ((def->os.arch != VIR_ARCH_ARMV6L) &&
-        (def->os.arch != VIR_ARCH_ARMV7L) &&
-        (def->os.arch != VIR_ARCH_AARCH64) &&
-        !ARCH_IS_RISCV(def->os.arch))
-        return true;
-
-    if (STREQ(def->os.machine, "versatilepb"))
-        return true;
-
-    if ((qemuDomainIsARMVirt(def) ||
-         qemuDomainIsRISCVVirt(def)) &&
-        virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
-        return true;
-
-    return false;
-}
-
-
 static void
 qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont,
                                            virDomainDefPtr 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