• P
    virtio-pci: add device_unplugged callback · 06a13073
    Paolo Bonzini 提交于
    This fixes a crash in hot-unplug of virtio-pci devices behind a PCIe
    switch.  The crash happens because the ioeventfd is still set whent the
    child is destroyed (destruction happens in postorder).  Then the proxy
    tries to unset to ioeventfd, but the virtqueue structure that holds the
    EventNotifier has been trashed in the meanwhile.  kvm_set_ioeventfd_pio
    does not expect failure and aborts.
    
    The fix is simply to move parts of uninitialization to a new
    device_unplugged callback, which is called before the child is destroyed.
    
    Cc: qemu-stable@nongnu.org
    Acked-by: NAndreas Faerber <afaerber@suse.de>
    Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
    06a13073
virtio-pci.c 50.9 KB