mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
qemu: Add PCI support for RISC-V guests
virtio-mmio is still used by default, so if PCI is desired it's necessary to explicitly opt-in by adding an appropriate <address type='pci' domain='0x0000' ... /> element to the corresponding device. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
030f963129
commit
e266a41f1e
@ -1732,11 +1732,12 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps,
|
||||
if (ARCH_IS_S390(def->os.arch))
|
||||
return true;
|
||||
|
||||
/* If ARM 'virt' supports PCI, it supports multibus.
|
||||
* No extra conditions here for simplicity.
|
||||
*/
|
||||
if (qemuDomainIsARMVirt(def))
|
||||
/* If the virt machine, both on ARM and RISC-V, supports PCI,
|
||||
* then it also supports multibus */
|
||||
if (qemuDomainIsARMVirt(def) ||
|
||||
qemuDomainIsRISCVVirt(def)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -3380,6 +3380,8 @@ qemuDomainDefAddDefaultDevices(virDomainDefPtr def,
|
||||
case VIR_ARCH_RISCV32:
|
||||
case VIR_ARCH_RISCV64:
|
||||
addDefaultUSB = false;
|
||||
if (qemuDomainIsRISCVVirt(def))
|
||||
addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
|
||||
break;
|
||||
|
||||
case VIR_ARCH_S390:
|
||||
|
@ -2369,7 +2369,8 @@ qemuDomainSupportsPCI(virDomainDefPtr def,
|
||||
if (STREQ(def->os.machine, "versatilepb"))
|
||||
return true;
|
||||
|
||||
if (qemuDomainIsARMVirt(def) &&
|
||||
if ((qemuDomainIsARMVirt(def) ||
|
||||
qemuDomainIsRISCVVirt(def)) &&
|
||||
virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX))
|
||||
return true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user