From patchwork Mon Nov 28 17:37:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 128033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7C30BB6F82 for ; Tue, 29 Nov 2011 04:37:33 +1100 (EST) Received: from localhost ([::1]:49053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV590-0001mn-Jm for incoming@patchwork.ozlabs.org; Mon, 28 Nov 2011 12:37:30 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV58v-0001mh-D9 for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:37:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RV58u-0001b2-7q for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:37:25 -0500 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:41500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RV58t-0001aY-Kv for qemu-devel@nongnu.org; Mon, 28 Nov 2011 12:37:24 -0500 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Nov 2011 23:07:19 +0530 Received: from d28relay01.in.ibm.com ([9.184.220.58]) by e28smtp09.in.ibm.com ([192.168.1.139]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Nov 2011 23:07:15 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pASHbE884665454 for ; Mon, 28 Nov 2011 23:07:15 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pASHbEJU005059 for ; Tue, 29 Nov 2011 04:37:14 +1100 Received: from skywalker.ibm.com ([9.126.239.69]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pASHbD3f005023; Tue, 29 Nov 2011 04:37:13 +1100 From: "Aneesh Kumar K.V" To: qemu-devel@nongnu.org Date: Mon, 28 Nov 2011 23:07:12 +0530 Message-Id: <1322501832-9775-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 x-cbid: 11112817-2674-0000-0000-000001E3BB8B X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 122.248.162.9 Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Subject: [Qemu-devel] [PATCH] hw/9pfs: Add qdev.reset callback for virtio-9p-pci device X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Aneesh Kumar K.V" Add the device reset callback Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p-device.c | 3 ++- hw/virtio-pci.c | 2 +- hw/virtio-pci.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/9pfs/virtio-9p-device.c b/hw/9pfs/virtio-9p-device.c index bba4c54..57dc77c 100644 --- a/hw/9pfs/virtio-9p-device.c +++ b/hw/9pfs/virtio-9p-device.c @@ -176,7 +176,8 @@ static PCIDeviceInfo virtio_9p_info = { DEFINE_PROP_STRING("mount_tag", VirtIOPCIProxy, fsconf.tag), DEFINE_PROP_STRING("fsdev", VirtIOPCIProxy, fsconf.fsdev_id), DEFINE_PROP_END_OF_LIST(), - } + }, + .qdev.reset = virtio_pci_reset, }; static void virtio_9p_register_devices(void) diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index ca5923c..07f5861 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -266,7 +266,7 @@ static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy) proxy->ioeventfd_started = false; } -static void virtio_pci_reset(DeviceState *d) +void virtio_pci_reset(DeviceState *d) { VirtIOPCIProxy *proxy = container_of(d, VirtIOPCIProxy, pci_dev.qdev); virtio_pci_stop_ioeventfd(proxy); diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h index f8404de..344c22b 100644 --- a/hw/virtio-pci.h +++ b/hw/virtio-pci.h @@ -45,6 +45,7 @@ typedef struct { } VirtIOPCIProxy; void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev); +void virtio_pci_reset(DeviceState *d); /* Virtio ABI version, if we increment this, we break the guest driver. */ #define VIRTIO_PCI_ABI_VERSION 0