The current logic can allow libvirt to issue a secondary bus reset despite the host having devices on the same bus as a device that's being assigned to a guest. The following patches refactor the code a little and then update the secondary bus reset logic to properly deal with active devices. This has been lightly tested, testing is still incomplete, hence the RFC to get any style comments out of the way once testing verifies this is working as expected. The following scenarios have been successfully tested: - Do not issue a secondary bus reset: - start guest w/ domain conf including hostdev that shares bus w/ devices owned by host - use attach-device to dynamically add hostdev to guest, hostdev shares bus w/ devices owned by host - attempt to node-reset a device assigned to guest - Issue a secondary bus reset: - start guest w/ domain conf including all devices on bus[1] - use attach-device to dynamically add hostdev to guest, hostdev does not share bus with other devices Not yet tested: - Issue a secondary bus reset: - when shutting down domain - when detaching device from domain [1] guest did not succesfully start w/ these devices, unclear if this patch series is implicated. Chris Wright (4): qemuGetPciHostDeviceList take hostdev list directly Add helpers qemuPrepareHostdevPCIDevices and qemuDomainReAttachHostdevDevices qemudDomainAttachHostPciDevice refactor to use new helpers pciResetDevice: use inactive devices to determine safe reset src/qemu/qemu_driver.c | 87 ++++++++++++++++++++---------------------------- src/util/pci.c | 20 ++++++----- src/util/pci.h | 3 +- src/xen/xen_driver.c | 2 +- 4 files changed, 50 insertions(+), 62 deletions(-) -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list