[libvirt] [PATCH] qemu: allow 32 slots on pcie-expander-bus, not just 1

When I added support for the pcie-expander-bus controller in commit bc07251f, I incorrectly thought that it only had a single slot available. Actually it has 32 slots, just like the root complex aka pcie-root (the part that I *did* get correct is that unlike pcie-root a pcie-expander-bus doesn't allow any integrated endpoint devices - only pcie-root-ports and dmi-to-pci-controllers are allowed). --- src/conf/domain_addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 93026c2..0406b50 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -304,13 +304,13 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; case VIR_DOMAIN_CONTROLLER_MODEL_PCIE_EXPANDER_BUS: - /* single slot, no hotplug, only accepts pcie-root-port or + /* 32 slots, no hotplug, only accepts pcie-root-port or * dmi-to-pci-bridge */ bus->flags = (VIR_PCI_CONNECT_TYPE_PCIE_ROOT_PORT | VIR_PCI_CONNECT_TYPE_DMI_TO_PCI_BRIDGE); bus->minSlot = 0; - bus->maxSlot = 0; + bus->maxSlot = VIR_PCI_ADDRESS_SLOT_LAST; break; default: -- 2.7.4

On Wed, Oct 05, 2016 at 11:34:13AM -0400, Laine Stump wrote:
When I added support for the pcie-expander-bus controller in commit bc07251f, I incorrectly thought that it only had a single slot available. Actually it has 32 slots, just like the root complex aka pcie-root (the part that I *did* get correct is that unlike pcie-root a pcie-expander-bus doesn't allow any integrated endpoint devices - only pcie-root-ports and dmi-to-pci-controllers are allowed). --- src/conf/domain_addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ACK, works for me. But the message when the slot is exceeded (without your patch, I just wanted to try everything) is really bad: error: XML error: Invalid PCI address 0000:03:01.0. slot must be <= 0 Anyway, that's not related to this fix =) Martin

On 10/05/2016 12:25 PM, Martin Kletzander wrote:
On Wed, Oct 05, 2016 at 11:34:13AM -0400, Laine Stump wrote:
When I added support for the pcie-expander-bus controller in commit bc07251f, I incorrectly thought that it only had a single slot available. Actually it has 32 slots, just like the root complex aka pcie-root (the part that I *did* get correct is that unlike pcie-root a pcie-expander-bus doesn't allow any integrated endpoint devices - only pcie-root-ports and dmi-to-pci-controllers are allowed). --- src/conf/domain_addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
ACK, works for me.
Thanks, I pushed it.
But the message when the slot is exceeded (without your patch, I just wanted to try everything) is really bad:
error: XML error: Invalid PCI address 0000:03:01.0. slot must be <= 0
Yeah, I guess it's worth a special case when min and max are equal (to 0, in practice)
participants (2)
-
Laine Stump
-
Martin Kletzander