From 11d5271ebbe97f97879e4da9a97451a9efd89b6f Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Thu, 17 Aug 2017 14:11:56 +0200 Subject: [PATCH] docs: Improve PCI topology and hotplug guidelines Address some minor flaws in the original document that were pointed out during review. Signed-off-by: Andrea Bolognani --- docs/pci-hotplug.html.in | 46 ++++++++++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/docs/pci-hotplug.html.in b/docs/pci-hotplug.html.in index 809e36f5d9..cddc6f81b4 100644 --- a/docs/pci-hotplug.html.in +++ b/docs/pci-hotplug.html.in @@ -13,10 +13,12 @@

The reason for this apparent limitation is the fact that each hotplugged PCI device might require additional PCI controllers to - be added to the guest, and libvirt has no way of knowing in advance - how many devices will be hotplugged during the guest's lifetime, - thus making it impossible to automatically provide the right amount - of PCI controllers: any arbitrary number would end up being too big + be added to the guest. Since most PCI controllers can't be + hotplugged, they need to be added before the guest is started; + however, libvirt has no way of knowing in advance how many devices + will be hotplugged during the guest's lifetime, thus making it + impossible to automatically provide the right amount of PCI + controllers: any arbitrary number would end up being too big for some users, and too small for others.

@@ -52,6 +54,14 @@ and supports hotplugging a single PCI Express device, either emulated or assigned from the host.

+

+ If you have a very specific use case, such as the appliances + used by libguestfs behind + the scenes to access disk images, and this automatically-added + pcie-root-port controller ends up being a nuisance, + you can prevent libvirt from adding it by manually managing PCI + controllers and addresses according to your needs. +

Slots on the pcie-root controller do not support hotplug, so the device will be hotplugged into the @@ -72,6 +82,12 @@ information you need to provide: libvirt will fill in the remaining details automatically.

+

+ Note that if you're adding PCI controllers to a guest and at + the same time you're also adding PCI devices, some of the + controllers will be used for the newly-added devices and won't + be available for hotplug once the guest has been started. +

If you expect to hotplug legacy PCI devices, then you will need specialized controllers, since all those mentioned above are @@ -84,7 +100,8 @@

and you'll be able to hotplug up to 31 legacy PCI devices, - either emulated or assigned from the host. + either emulated or assigned from the host, in the slots + from 0x01 to 0x1f of the pci-bridge controller.

i440fx (pc) machine type

@@ -98,9 +115,10 @@ <controller type='pci' index='0' model='pci-root'/>

- where each of the 31 slots on the pci-root - controller is hotplug capable and can accept a legacy PCI - device, either emulated or assigned from the guest. + where each of the 31 slots (from 0x01 to 0x1f) on the + pci-root controller is hotplug capable and + can accept a legacy PCI device, either emulated or + assigned from the guest.

ppc64 architecture

@@ -119,12 +137,12 @@ </controller>

- The 31 slots on a pci-root controller are all - hotplug capable and, despite the name suggesting otherwise, - starting with QEMU 2.9 all of them can accept PCI Express - devices in addition to legacy PCI devices; however, - libvirt will only place emulated devices on the default - pci-root controller. + The 31 slots, from 0x01 to 0x1f, on a pci-root + controller are all hotplug capable and, despite the name + suggesting otherwise, starting with QEMU 2.9 all of them + can accept PCI Express devices in addition to legacy PCI + devices; however, libvirt will only place emulated devices + on the default pci-root controller.

In order to take advantage of improved error reporting and