diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-03-18 17:37:20 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-03-18 13:08:39 -0500 |
commit | 10479a80893fb2666026ce0fea2251be3070b6e2 (patch) | |
tree | ea902ad6f540bce7d848ff075ced2eed60cd3abd /hw/virtio-pci.c | |
parent | cbd19063e75c64ac5e4029f76198c7ba65a63b00 (diff) |
virtio-pci: fix hot unplug.
Hot unplug failed because it tried to free the virtio device two times.
This fix the issue by removing the call to virtio_bus_destroy_device.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Message-id: 1363624648-16906-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r-- | hw/virtio-pci.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c795cc6339..f0dd823849 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -1412,13 +1412,6 @@ static void virtio_pci_device_plugged(DeviceState *d) proxy->host_features); } -/* This is called by virtio-bus just before the device is unplugged. */ -static void virtio_pci_device_unplug(DeviceState *d) -{ - VirtIOPCIProxy *dev = VIRTIO_PCI(d); - virtio_pci_stop_ioeventfd(dev); -} - static int virtio_pci_init(PCIDevice *pci_dev) { VirtIOPCIProxy *dev = VIRTIO_PCI(pci_dev); @@ -1433,10 +1426,7 @@ static int virtio_pci_init(PCIDevice *pci_dev) static void virtio_pci_exit(PCIDevice *pci_dev) { VirtIOPCIProxy *proxy = VIRTIO_PCI(pci_dev); - VirtioBusState *bus = VIRTIO_BUS(&proxy->bus); - BusState *qbus = BUS(&proxy->bus); - virtio_bus_destroy_device(bus); - qbus_free(qbus); + virtio_pci_stop_ioeventfd(proxy); virtio_exit_pci(pci_dev); } @@ -1503,7 +1493,6 @@ static void virtio_pci_bus_class_init(ObjectClass *klass, void *data) k->set_guest_notifiers = virtio_pci_set_guest_notifiers; k->vmstate_change = virtio_pci_vmstate_change; k->device_plugged = virtio_pci_device_plugged; - k->device_unplug = virtio_pci_device_unplug; } static const TypeInfo virtio_pci_bus_info = { |