]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: set/use proper pciConnectFlags during hotplug
authorLaine Stump <laine@laine.org>
Wed, 7 Sep 2016 16:29:30 +0000 (12:29 -0400)
committerLaine Stump <laine@laine.org>
Mon, 14 Nov 2016 19:09:10 +0000 (14:09 -0500)
commitabb7a4bd6bb416c55c8bf664c2cb9a5cec411503
tree48041bb1a6bccef188d369451346f19437d0637a
parent7f784f576b96eee68849dff1759eefe86c534df7
qemu: set/use proper pciConnectFlags during hotplug

Before now, all the qemu hotplug functions assumed that all devices to
be hotplugged were legacy PCI endpoint devices
(VIR_PCI_CONNECT_TYPE_PCI_DEVICE). This worked out "okay", because all
devices *are* legacy PCI endpoint devices on x86/440fx machinetypes,
and hotplug didn't work properly on machinetypes using PCIe anyway
(hotplugging onto a legacy PCI slot doesn't work, and until commit
b87703cf any attempt to manually specify a PCIe address for a
hotplugged device would be erroneously rejected).

This patch makes all qemu hotplug operations honor the pciConnectFlags
set by the single all-knowing function
qemuDomainDeviceCalculatePCIConnectFlags(). This is done in 3 steps,
but in a single commit since we would have to touch the other points
at each step anyway:

1) add a flags argument to the hypervisor-agnostic
virDomainPCIAddressEnsureAddr() (previously it hardcoded
..._PCI_DEVICE)

2) add a new qemu-specific function qemuDomainEnsurePCIAddress() which
gets the correct pciConnectFlags for the device from
qemuDomainDeviceConnectFlags(), then calls
virDomainPCIAddressEnsureAddr().

3) in qemu_hotplug.c replace all calls to
virDomainPCIAddressEnsureAddr() with calls to
qemuDomainEnsurePCIAddress()

So in effect, we're putting a "shim" on top of all calls to
virDomainPCIAddressEnsureAddr() that sets the right pciConnectFlags.
src/conf/domain_addr.c
src/conf/domain_addr.h
src/qemu/qemu_domain_address.c
src/qemu/qemu_domain_address.h
src/qemu/qemu_hotplug.c