For all versions of QEMU that we support, this is guaranteed to
be compiled in both on aarch64 and on riscv64, so we can stop
checking whether the capability is present and just use the
device unconditionally.
Signed-off-by: Andrea Bolognani <abologna(a)redhat.com>
---
src/qemu/qemu_domain.c | 12 +++++-------
src/qemu/qemu_domain.h | 3 +--
src/qemu/qemu_domain_address.c | 2 +-
3 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index e2a1bf2c13..7c87cd6453 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4168,7 +4168,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
addDefaultUSB = false;
addDefaultMemballoon = false;
if (qemuDomainIsARMVirt(def))
- addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
+ addPCIeRoot = true;
break;
case VIR_ARCH_PPC64:
@@ -4195,7 +4195,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
case VIR_ARCH_RISCV64:
addDefaultUSB = false;
if (qemuDomainIsRISCVVirt(def))
- addPCIeRoot = virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX);
+ addPCIeRoot = true;
break;
case VIR_ARCH_S390:
@@ -9059,8 +9059,7 @@ qemuDomainNeedsFDC(const virDomainDef *def)
bool
-qemuDomainSupportsPCI(virDomainDef *def,
- virQEMUCaps *qemuCaps)
+qemuDomainSupportsPCI(virDomainDef *def)
{
if (def->os.arch != VIR_ARCH_ARMV6L &&
def->os.arch != VIR_ARCH_ARMV7L &&
@@ -9072,9 +9071,8 @@ qemuDomainSupportsPCI(virDomainDef *def,
if (STREQ(def->os.machine, "versatilepb"))
return true;
- if ((qemuDomainIsARMVirt(def) ||
- qemuDomainIsRISCVVirt(def)) &&
- virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_GPEX)) {
+ if (qemuDomainIsARMVirt(def) ||
+ qemuDomainIsRISCVVirt(def)) {
return true;
}
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index fa566dded6..b0f1587f58 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -834,8 +834,7 @@ bool qemuDomainHasPCIeRoot(const virDomainDef *def);
bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
bool qemuDomainHasBuiltinESP(const virDomainDef *def);
bool qemuDomainNeedsFDC(const virDomainDef *def);
-bool qemuDomainSupportsPCI(virDomainDef *def,
- virQEMUCaps *qemuCaps);
+bool qemuDomainSupportsPCI(virDomainDef *def);
void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm);
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
index 099778b2a8..888ae70d95 100644
--- a/src/qemu/qemu_domain_address.c
+++ b/src/qemu/qemu_domain_address.c
@@ -2843,7 +2843,7 @@ qemuDomainAssignPCIAddresses(virDomainDef *def,
if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false)))
goto cleanup;
- if (qemuDomainSupportsPCI(def, qemuCaps)) {
+ if (qemuDomainSupportsPCI(def)) {
if (qemuDomainValidateDevicePCISlotsChipsets(def, addrs) < 0)
goto cleanup;
--
2.43.0