45e84a0
From 64dd41bc2de392fa018c5ce804cc451b83f18b94 Mon Sep 17 00:00:00 2001
45e84a0
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
45e84a0
Date: Sun, 4 Dec 2011 22:35:28 +0530
45e84a0
Subject: [PATCH 06/25] hw/9pfs: Add qdev.reset callback for virtio-9p-pci
45e84a0
 device
45e84a0
45e84a0
Add the device reset callback
45e84a0
45e84a0
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
45e84a0
---
45e84a0
 hw/9pfs/virtio-9p-device.c |    3 ++-
45e84a0
 hw/virtio-pci.c            |    2 +-
45e84a0
 hw/virtio-pci.h            |    1 +
45e84a0
 3 files changed, 4 insertions(+), 2 deletions(-)
45e84a0
45e84a0
diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c
45e84a0
index c9bca8b..cd343e1 100644
45e84a0
--- a/hw/9pfs/virtio-9p-device.c
45e84a0
+++ b/hw/9pfs/virtio-9p-device.c
45e84a0
@@ -176,7 +176,8 @@ static PCIDeviceInfo virtio_9p_info = {
45e84a0
         DEFINE_PROP_STRING("mount_tag", VirtIOPCIProxy, fsconf.tag),
45e84a0
         DEFINE_PROP_STRING("fsdev", VirtIOPCIProxy, fsconf.fsdev_id),
45e84a0
         DEFINE_PROP_END_OF_LIST(),
45e84a0
-    }
45e84a0
+    },
45e84a0
+    .qdev.reset = virtio_pci_reset,
45e84a0
 };
45e84a0
45e84a0
 static void virtio_9p_register_devices(void)
45e84a0
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
45e84a0
index 64c6a94..c665f5c 100644
45e84a0
--- a/hw/virtio-pci.c
45e84a0
+++ b/hw/virtio-pci.c
45e84a0
@@ -266,7 +266,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy)
45e84a0
     proxy->ioeventfd_started = false;
45e84a0
 }
45e84a0
45e84a0
-static void virtio_pci_reset(DeviceState *d)
45e84a0
+void virtio_pci_reset(DeviceState *d)
45e84a0
 {
45e84a0
     VirtIOPCIProxy *proxy = container_of(d, VirtIOPCIProxy, pci_dev.qdev);
45e84a0
     virtio_pci_stop_ioeventfd(proxy);
45e84a0
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
45e84a0
index f8404de..344c22b 100644
45e84a0
--- a/hw/virtio-pci.h
45e84a0
+++ b/hw/virtio-pci.h
45e84a0
@@ -45,6 +45,7 @@ typedef struct {
45e84a0
 } VirtIOPCIProxy;
45e84a0
45e84a0
 void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
45e84a0
+void virtio_pci_reset(DeviceState *d);
45e84a0
45e84a0
 /* Virtio ABI version, if we increment this, we break the guest driver. */
45e84a0
 #define VIRTIO_PCI_ABI_VERSION          0
45e84a0
-- 
45e84a0
1.7.7.5
45e84a0