[PATCH 13/18] qemu: Improve qemuDomainSupportsPCIMultibus()

Andrea Bolognani posted 18 patches 12 months ago
[PATCH 13/18] qemu: Improve qemuDomainSupportsPCIMultibus()
Posted by Andrea Bolognani 12 months ago
Rewrite the function so that it's more compact and easier to
extend as new architectures, which will likely come with
multibus support right out the gate, are introduced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/qemu/qemu_domain.c | 21 +++++++--------------
 1 file changed, 7 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ef7506258a..de36641137 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9088,23 +9088,16 @@ qemuDomainSupportsPCI(const virDomainDef *def)
 bool
 qemuDomainSupportsPCIMultibus(const virDomainDef *def)
 {
-    /* x86_64 and i686 support PCI-multibus on all machine types
-     * since forever */
-    if (ARCH_IS_X86(def->os.arch))
-        return true;
-
-    /* PPC supports multibus on all machine types which have pci since qemu-2.0.0 */
-    if (def->os.arch == VIR_ARCH_PPC ||
-        ARCH_IS_PPC64(def->os.arch)) {
+    /* Most architectures support multibus for all machine types on
+     * all supported QEMU versions */
+    if (ARCH_IS_X86(def->os.arch) ||
+        ARCH_IS_PPC(def->os.arch) ||
+        ARCH_IS_S390(def->os.arch)) {
         return true;
     }
 
-    /* S390 supports PCI-multibus. */
-    if (ARCH_IS_S390(def->os.arch))
-        return true;
-
-    /* If the virt machine, both on ARM and RISC-V, supports PCI,
-     * then it also supports multibus */
+    /* In some cases, support for multibus is limited to some machine
+     * types */
     if (qemuDomainIsARMVirt(def) ||
         qemuDomainIsRISCVVirt(def)) {
         return true;
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 13/18] qemu: Improve qemuDomainSupportsPCIMultibus()
Posted by Ján Tomko 12 months ago
On a Wednesday in 2024, Andrea Bolognani wrote:
>Rewrite the function so that it's more compact and easier to
>extend as new architectures, which will likely come with
>multibus support right out the gate, are introduced.
>
>Signed-off-by: Andrea Bolognani <abologna@redhat.com>
>---
> src/qemu/qemu_domain.c | 21 +++++++--------------
> 1 file changed, 7 insertions(+), 14 deletions(-)
>

For patches 1 to 13:

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH 13/18] qemu: Improve qemuDomainSupportsPCIMultibus()
Posted by Peter Krempa 12 months ago
On Wed, Jan 17, 2024 at 10:54:46 +0100, Andrea Bolognani wrote:
> Rewrite the function so that it's more compact and easier to
> extend as new architectures, which will likely come with
> multibus support right out the gate, are introduced.
> 
> Signed-off-by: Andrea Bolognani <abologna@redhat.com>
> ---
>  src/qemu/qemu_domain.c | 21 +++++++--------------
>  1 file changed, 7 insertions(+), 14 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org