[PATCH 2/4] qemu: Unify address assignment for virt guests

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

 



The rules are the same for all virt guests, regardless of the
architecture.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_domain_address.c | 38 ++++++++--------------------------
 1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 9592dbfa60..2ec21e65ac 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -460,19 +460,23 @@ qemuDomainHasVirtioMMIODevices(virDomainDefPtr def)
 
 
 static void
-qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
-                                       virQEMUCapsPtr qemuCaps)
+qemuDomainAssignVirtioMMIOAddresses(virDomainDefPtr def,
+                                    virQEMUCapsPtr qemuCaps)
 {
     if (def->os.arch != VIR_ARCH_ARMV6L &&
         def->os.arch != VIR_ARCH_ARMV7L &&
-        def->os.arch != VIR_ARCH_AARCH64)
+        def->os.arch != VIR_ARCH_AARCH64 &&
+        !ARCH_IS_RISCV(def->os.arch)) {
         return;
+    }
 
     if (!(STRPREFIX(def->os.machine, "vexpress-") ||
-          qemuDomainIsARMVirt(def)))
+          qemuDomainIsARMVirt(def) ||
+          qemuDomainIsRISCVVirt(def))) {
         return;
+    }
 
-    /* We use virtio-mmio by default on mach-virt guests only if they already
+    /* We use virtio-mmio by default on virt guests only if they already
      * have at least one virtio-mmio device: in all other cases, assuming
      * the QEMU binary supports all necessary capabilities (PCIe Root plus
      * some kind of PCIe Root Port), we prefer virtio-pci */
@@ -489,30 +493,6 @@ qemuDomainAssignARMVirtioMMIOAddresses(virDomainDefPtr def,
 }
 
 
-static void
-qemuDomainAssignRISCVVirtioMMIOAddresses(virDomainDefPtr def,
-                                         virQEMUCapsPtr qemuCaps)
-{
-    if (!qemuDomainIsRISCVVirt(def))
-        return;
-
-    if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MMIO)) {
-        qemuDomainPrimeVirtioDeviceAddresses(def,
-                                             VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO);
-    }
-}
-
-
-static void
-qemuDomainAssignVirtioMMIOAddresses(virDomainDefPtr def,
-                                    virQEMUCapsPtr qemuCaps)
-{
-    qemuDomainAssignARMVirtioMMIOAddresses(def, qemuCaps);
-
-    qemuDomainAssignRISCVVirtioMMIOAddresses(def, qemuCaps);
-}
-
-
 static bool
 qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device)
 {
-- 
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