summaryrefslogtreecommitdiff
path: root/hw/virtio-pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/virtio-pci.c')
-rw-r--r--hw/virtio-pci.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 3a0702455..1357d40b9 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -24,6 +24,7 @@
#include "net.h"
#include "loader.h"
#include "kvm.h"
+#include "blockdev.h"
/* from Linux's linux/virtio_pci.h */
@@ -633,6 +634,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);
@@ -723,7 +732,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),