mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
virtio-serial: Cleanup on device hot-unplug
Free malloc'ed memory, unregister from savevm and clean up virtio-common bits on device hot-unplug. This was found performing a migration after device hot-unplug. Reported-by: <lihuang@redhat.com> Signed-off-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
583cd3cb93
commit
8b53a86577
3 changed files with 27 additions and 1 deletions
|
@ -599,6 +599,14 @@ static int virtio_serial_init_pci(PCIDevice *pci_dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int virtio_serial_exit_pci(PCIDevice *pci_dev)
|
||||
{
|
||||
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
|
||||
|
||||
virtio_serial_exit(proxy->vdev);
|
||||
return virtio_exit_pci(pci_dev);
|
||||
}
|
||||
|
||||
static int virtio_net_init_pci(PCIDevice *pci_dev)
|
||||
{
|
||||
VirtIOPCIProxy *proxy = DO_UPCAST(VirtIOPCIProxy, pci_dev, pci_dev);
|
||||
|
@ -689,7 +697,7 @@ static PCIDeviceInfo virtio_info[] = {
|
|||
.qdev.alias = "virtio-serial",
|
||||
.qdev.size = sizeof(VirtIOPCIProxy),
|
||||
.init = virtio_serial_init_pci,
|
||||
.exit = virtio_exit_pci,
|
||||
.exit = virtio_serial_exit_pci,
|
||||
.qdev.props = (Property[]) {
|
||||
DEFINE_PROP_UINT32("vectors", VirtIOPCIProxy, nvectors,
|
||||
DEV_NVECTORS_UNSPECIFIED),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue