• E
    qemu: hostdev: Fix the error on VM start with an mdev when IOMMU is off · e02d102b
    Erik Skultety 提交于
    Commit b4c2ac8d 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: NErik Skultety <eskultet@redhat.com>
    e02d102b
qemu_hostdev.c 14.6 KB