]> xenbits.xensource.com Git - libvirt.git/commit
qemu: propagate virQEMUDriver object to qemuDomainDeviceCalculatePCIConnectFlags
authorLaine Stump <laine@laine.org>
Thu, 3 Nov 2016 20:33:32 +0000 (16:33 -0400)
committerLaine Stump <laine@laine.org>
Wed, 30 Nov 2016 20:28:07 +0000 (15:28 -0500)
commit9b0848d52349a432244da49b64e99a211f85a26b
treedf3167773d25d25403bb0e64e94b270d231a9dbc
parentbfdc14515366894348e943ff33671f19037bf4d6
qemu: propagate virQEMUDriver object to qemuDomainDeviceCalculatePCIConnectFlags

If libvirtd is running unprivileged, it can open a device's PCI config
data in sysfs, but can only read the first 64 bytes. But as part of
determining whether a device is Express or legacy PCI,
qemuDomainDeviceCalculatePCIConnectFlags() will be updated in a future
patch to call virPCIDeviceIsPCIExpress(), which tries to read beyond
the first 64 bytes of the PCI config data and fails with an error log
if the read is unsuccessful.

In order to avoid creating a parallel "quiet" version of
virPCIDeviceIsPCIExpress(), this patch passes a virQEMUDriverPtr down
through all the call chains that initialize the
qemuDomainFillDevicePCIConnectFlagsIterData, and saves the driver
pointer with the rest of the iterdata so that it can be used by
qemuDomainDeviceCalculatePCIConnectFlags(). This pointer isn't used
yet, but will be used in an upcoming patch (that detects Express vs
legacy PCI for VFIO assigned devices) to examine driver->privileged.
src/qemu/qemu_domain.c
src/qemu/qemu_domain_address.c
src/qemu/qemu_domain_address.h
src/qemu/qemu_hotplug.c
src/qemu/qemu_process.c
tests/qemuhotplugtest.c