[libvirt] [PATCH v2 0/2] check IOMMU group devices usage when preparing device for vfio passthrough

Shivaprasad G Bhat shivaprasadbhat at gmail.com
Wed Jan 14 11:01:53 UTC 2015


====================================================================
If a device in the same iommu group is in use by a different vm, the guest boot
fails with the below error during vfio passthrough.
bash-4.2$ virsh start demo
error: Failed to start domain demo
error: internal error: process exited while connecting to monitor:
2014-12-02T13:43:52.020136Z qemu-system-x86_64: -device vfio-pci,host=00:1c.3,id=hostdev0,bus=pci.0,addr=0x5: vfio: error opening /dev/vfio/7: Device or resource busy

Solution:
=====================================================================
The patch iterates through the iommu group devices and errors out cleanly
mentioning the device and the guest which is using the device.

With Patch
bash-4.2$ virsh start demo
error: Failed to start domain demo
error: Requested operation is not valid: PCI device 0000:0d:00.0 is in use by driver QEMU, domain vm10

---

Shivaprasad G Bhat (2):
      Implement virPCIDeviceGetAddress function
      check IOMMU group devices usage when preparing device for vfio passthrough


 src/util/virhostdev.c |   89 ++++++++++++++++++++++++++++++-------------------
 src/util/virpci.c     |   16 +++++++++
 src/util/virpci.h     |    1 +
 3 files changed, 72 insertions(+), 34 deletions(-)

-- 
Signature




More information about the libvir-list mailing list