[libvirt] [PATCH 0/6] Use more PCIe, less legacy PCI slots

Andrea Bolognani abologna at redhat.com
Tue Aug 9 13:11:46 UTC 2016

On Mon, 2016-08-08 at 04:56 -0400, Laine Stump wrote:
> These patches use three methods to get more of the PCI devices onto PCIe
> slots on Q35 and aarch64/virt machinetypes:
> 1) When virtio devices can present themselves as PCIe if they're
>    plugged into a PCIe controller, do that. (This capability is
>    detected by looking for presence of the "disable-modern" option on
>    the virtio-net device. If you have a better idea for how to detect
>    it, please let me know.)

How does this play along with Ján's series[1] implementing a
way to control the protocol revision for virtio devices?

IIUC, you wouldn't set disable-modern=off or disable-legacy=on
explicitly, but rely instead on the fact that a mixed-mode
virtio device will present itself as PCIe if plugged into a
PCIe slot. Is that right?

I think we should alter the connect flags for virtio devices
based on the protocol revision, as decided by the user with
either Ján's or a comparable approach, rather than using PCIe
automatically if available.

At the very least, the current approaches don't mix - if both
your series and Ján's were to be merged now, a device that has
been configured to use virtio 0.9 would end up assigned to a
PCIe slot.

> 2) Any devices that aren't hotpluggable anyway will no longer request
>    a hotplug-capable slot. This, along with a change to auto-assign
>    legacy PCI devices to pcie-root (as long as they don't require
>    hotplug) means the devices will now be assigned to pcie-root.
> 3) Also using the fact that devices that won't be hotplugged can be
>    assigned to pcie-root, the devices that *do* support hotplug have a
>    new optional subelement "<hotplug require='no'/>" (it defaults to
>    "yes" for historical reasons). If hotplug require is set to 'no',
>    even a PCI device can be auto-assigned to pcie-root.
> I haven't yet removed the dmi-to-pci-bridge that is added by default,
> and we still will only auto-add pci-bridge (so if you're adding a
> virtio device without <hostplug require='no'/> then you will also need
> to add a <controller type='pci' model='pcie-root-port'/> to plug it
> into).

I don't get any dmi-to-pci-bridge on aarch64 virt guests,
which is good because we don't want it at the moment :)

But it doesn't get auto-added either, not even when it would
be required because I'm trying to add a legacy PCI device. So
yeah, more work needed there I guess.

[1] https://www.redhat.com/archives/libvir-list/2016-August/msg00412.html
Andrea Bolognani / Red Hat / Virtualization

More information about the libvir-list mailing list