On Wed, Jan 14, 2015 at 10:34 PM, Michal Privoznik <mprivozn(a)redhat.com> wrote:
On 14.01.2015 12:01, Shivaprasad G Bhat wrote:
> ====================================================================
> 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(-)
>
I've fixed issues I've raised and pushed.
Thanks for fixing and pushing Michal.. Not sure how I missed it. I'll
be cautious using make check in future.
Regards,
Shiva
Michal