mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
qemu: Move qemuDomainSupportsPCIMultibus()
It belongs next to qemuDomainSupportsPCI(). Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
11a861e9e9
commit
176c3b105e
@ -142,7 +142,7 @@ qemuAssignDeviceControllerAlias(virDomainDef *domainDef,
|
||||
return;
|
||||
|
||||
if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) {
|
||||
if (!virQEMUCapsHasPCIMultiBus(domainDef)) {
|
||||
if (!qemuDomainSupportsPCIMultibus(domainDef)) {
|
||||
/* qemus that don't support multiple PCI buses have
|
||||
* hardcoded the name of their single PCI controller as
|
||||
* "pci".
|
||||
|
@ -2059,34 +2059,6 @@ virQEMUCapsGet(virQEMUCaps *qemuCaps,
|
||||
}
|
||||
|
||||
|
||||
bool virQEMUCapsHasPCIMultiBus(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)) {
|
||||
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 */
|
||||
if (qemuDomainIsARMVirt(def) ||
|
||||
qemuDomainIsRISCVVirt(def)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const char *virQEMUCapsGetBinary(virQEMUCaps *qemuCaps)
|
||||
{
|
||||
return qemuCaps->binary;
|
||||
|
@ -701,8 +701,6 @@ bool virQEMUCapsGet(virQEMUCaps *qemuCaps,
|
||||
|
||||
void virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps);
|
||||
|
||||
bool virQEMUCapsHasPCIMultiBus(const virDomainDef *def);
|
||||
|
||||
bool virQEMUCapsSupportsVmport(virQEMUCaps *qemuCaps,
|
||||
const virDomainDef *def);
|
||||
|
||||
|
@ -386,7 +386,7 @@ qemuBuildDeviceAddressPCIGetBus(const virDomainDef *domainDef,
|
||||
* */
|
||||
if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT &&
|
||||
contTargetIndex <= 0) {
|
||||
if (virQEMUCapsHasPCIMultiBus(domainDef))
|
||||
if (qemuDomainSupportsPCIMultibus(domainDef))
|
||||
contAlias = "pci.0";
|
||||
else
|
||||
contAlias = "pci";
|
||||
|
@ -9085,6 +9085,35 @@ 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)) {
|
||||
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 */
|
||||
if (qemuDomainIsARMVirt(def) ||
|
||||
qemuDomainIsRISCVVirt(def)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDefValidateMemoryHotplugDevice(const virDomainMemoryDef *mem,
|
||||
const virDomainDef *def)
|
||||
|
@ -835,6 +835,7 @@ bool qemuDomainHasBuiltinIDE(const virDomainDef *def);
|
||||
bool qemuDomainHasBuiltinESP(const virDomainDef *def);
|
||||
bool qemuDomainNeedsFDC(const virDomainDef *def);
|
||||
bool qemuDomainSupportsPCI(const virDomainDef *def);
|
||||
bool qemuDomainSupportsPCIMultibus(const virDomainDef *def);
|
||||
|
||||
void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user