qemu-e2k/hw/virtio
Paolo Bonzini 06a1307379 virtio-pci: add device_unplugged callback
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: Andreas Faerber <afaerber@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-12-09 21:46:48 +01:00
..
dataplane virtio: clear signalled_used_valid when switching from dataplane 2013-08-12 12:19:04 +03:00
Makefile.objs virtio: Implement MMIO based virtio transport 2013-07-19 12:58:47 +01:00
vhost.c vhost: clear signalled_used_valid on vhost stop 2013-08-12 12:25:17 +03:00
virtio-balloon.c virtio-balloon: switch exit callback to VirtioDeviceClass 2013-12-09 21:46:48 +01:00
virtio-bus.c virtio-bus: cleanup plug/unplug interface 2013-12-09 21:46:48 +01:00
virtio-mmio.c virtio-bus: remove vdev field 2013-12-09 21:46:48 +01:00
virtio-pci.c virtio-pci: add device_unplugged callback 2013-12-09 21:46:48 +01:00
virtio-pci.h virtio-pci: remove vdev field 2013-12-09 21:46:48 +01:00
virtio-rng.c virtio-rng: switch exit callback to VirtioDeviceClass 2013-12-09 21:46:48 +01:00
virtio.c virtio-bus: cleanup plug/unplug interface 2013-12-09 21:46:48 +01:00