mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-27 13:52:20 +00:00
conf: Add virDomainPCIAddressSet.isPCIeToPCIBridgeSupported
Just like the existing areMultipleRootsSupported, this will allow us to change the results of the driver-agnostic PCI address allocation logic based on whether the QEMU binary supports certain features. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
542f05e775
commit
9985bb468a
@ -118,6 +118,8 @@ struct _virDomainPCIAddressSet {
|
|||||||
and addresses aren't saved in device infos */
|
and addresses aren't saved in device infos */
|
||||||
/* If true, the guest can have multiple pci-root controllers */
|
/* If true, the guest can have multiple pci-root controllers */
|
||||||
bool areMultipleRootsSupported;
|
bool areMultipleRootsSupported;
|
||||||
|
/* If true, the guest can use the pcie-to-pci-bridge controller */
|
||||||
|
bool isPCIeToPCIBridgeSupported;
|
||||||
};
|
};
|
||||||
typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet;
|
typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet;
|
||||||
typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr;
|
typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr;
|
||||||
|
@ -1338,6 +1338,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
static virDomainPCIAddressSetPtr
|
static virDomainPCIAddressSetPtr
|
||||||
qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
|
qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
|
||||||
|
virQEMUCapsPtr qemuCaps,
|
||||||
unsigned int nbuses,
|
unsigned int nbuses,
|
||||||
bool dryRun)
|
bool dryRun)
|
||||||
{
|
{
|
||||||
@ -1355,6 +1356,9 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def,
|
|||||||
if (qemuDomainIsPSeries(def))
|
if (qemuDomainIsPSeries(def))
|
||||||
addrs->areMultipleRootsSupported = true;
|
addrs->areMultipleRootsSupported = true;
|
||||||
|
|
||||||
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_PCIE_PCI_BRIDGE))
|
||||||
|
addrs->isPCIeToPCIBridgeSupported = true;
|
||||||
|
|
||||||
for (i = 0; i < def->ncontrollers; i++) {
|
for (i = 0; i < def->ncontrollers; i++) {
|
||||||
virDomainControllerDefPtr cont = def->controllers[i];
|
virDomainControllerDefPtr cont = def->controllers[i];
|
||||||
size_t idx = cont->idx;
|
size_t idx = cont->idx;
|
||||||
@ -2361,7 +2365,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
|
|||||||
|
|
||||||
if (nbuses > 0) {
|
if (nbuses > 0) {
|
||||||
/* 1st pass to figure out how many PCI bridges we need */
|
/* 1st pass to figure out how many PCI bridges we need */
|
||||||
if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses, true)))
|
if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, true)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainValidateDevicePCISlotsChipsets(def, qemuCaps,
|
if (qemuDomainValidateDevicePCISlotsChipsets(def, qemuCaps,
|
||||||
@ -2491,7 +2495,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def,
|
|||||||
addrs = NULL;
|
addrs = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(addrs = qemuDomainPCIAddressSetCreate(def, nbuses, false)))
|
if (!(addrs = qemuDomainPCIAddressSetCreate(def, qemuCaps, nbuses, false)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainSupportsPCI(def, qemuCaps)) {
|
if (qemuDomainSupportsPCI(def, qemuCaps)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user