]> xenbits.xensource.com Git - libvirt.git/commit
qemu: hostdev: Fix the error on VM start with an mdev when IOMMU is off
authorErik Skultety <eskultet@redhat.com>
Thu, 15 Mar 2018 13:58:22 +0000 (14:58 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 19 Mar 2018 10:14:40 +0000 (11:14 +0100)
commite02d102bac7e1ad3c002da327df3e8f88860e0c2
tree055a0dfc003fbdd923887f6789586da311b9f13a
parent3d2e4c3e53a179057552f0dc9a861657df62d303
qemu: hostdev: Fix the error on VM start with an mdev when IOMMU is off

Commit b4c2ac8d56 made a false assumption that IOMMU support necessary
for an mdev device to be assigned to a VM. Unlike direct PCI assignment,
IOMMU support is not needed for mediated devices, as the physical parent
device provides the isolation, therefore, simply checking for VFIO
presence is enough to successfully start a VM.

Luckily, this issue is not serious, since as of yet, libvirt mandates
mdevs to be pre-created prior to a domain's launch - if it is,
everything does work smoothly even with IOMMU disabled, because the
parent device will ensure the iommu groups we try to access exist.
However, if there are *no* IOMMU groups yet, thus no mdev exists yet, one
would see the following error:

"unsupported configuration: Mediated host device assignment requires VFIO
support"

The error msg above is simply wrong and doesn't even reflect the IOMMU
reality, so after applying this patch one would rather see the following
error in such case instead:

"device not found: mediated device '<UUID>' not found"

Signed-off-by: Erik Skultety <eskultet@redhat.com>
src/qemu/qemu_hostdev.c