]> git.ipfire.org Git - thirdparty/libvirt.git/commit
conf: pay attention to bus minSlot/maxSlot when autoassigning PCI addresses
authorLaine Stump <laine@laine.org>
Thu, 16 Jul 2015 20:28:47 +0000 (16:28 -0400)
committerLaine Stump <laine@laine.org>
Sat, 25 Jul 2015 14:08:03 +0000 (10:08 -0400)
commitd4cf72af175dec9ee09b171605409df7000f8356
treecdeab307d0acdfb1f60e3d33608e1d6d3bf2453f
parentbe6c35e4acdff92c9f9a875de28474a84367f742
conf: pay attention to bus minSlot/maxSlot when autoassigning PCI addresses

The function that auto-assigns PCI addresses was written with the
hardcoded assumptions that any PCI bus would have slots available
starting at 1 and ending at 31. This isn't true for many types of
controllers (some have a single slot/port at 0, some have slots/ports
from 0 to 31). This patch updates that function to remove the
hardcoded assumptions. It will properly find/assign addresses for
devices that can only connect to pcie-(root|downstream)-port (which
have minSlot/maxSlot of 0/0) or a pcie-switch-upstream-port (0/31).

It still will not auto-create a new bus of the proper kind for these
connections when one doesn't exist, that task is for another day.
src/conf/domain_addr.c