• C
    qemu: Fix race between device rebind and kvm cleanup · be34c3c7
    Chris Lalancette 提交于
    Certain hypervisors (like qemu/kvm) map the PCI bar(s) on
    the host when doing device passthrough.  This can lead to a race
    condition where the hypervisor is still cleaning up the device while
    libvirt is trying to re-attach it to the host device driver.  To avoid
    this situation, we look through /proc/iomem, and if the hypervisor is
    still holding onto the bar (denoted by the string in the matcher variable),
    then we can wait around a bit for that to clear up.
    
    v2: Thanks to review by DV, make sure we wait the full timeout per-device
    Signed-off-by: NChris Lalancette <clalance@redhat.com>
    be34c3c7
qemu_driver.c 259.2 KB