Received: from eggs.gnu.org ([2001:4830:134:3::10]:33498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvooX-0006tp-4x for qemu-devel@nongnu.org; Mon, 09 Nov 2015 10:57:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvooW-0004hL-5V for qemu-devel@nongnu.org; Mon, 09 Nov 2015 10:57:01 -0500 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:36491) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvooV-0004h4-Rt for qemu-devel@nongnu.org; Mon, 09 Nov 2015 10:57:00 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 9 Nov 2015 15:56:58 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 89BF22190046 for ; Mon, 9 Nov 2015 15:56:51 +0000 (GMT) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tA9Futjr59244556 for ; Mon, 9 Nov 2015 15:56:55 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tA9Fusap026009 for ; Mon, 9 Nov 2015 08:56:55 -0700 From: Cornelia Huck Date: Mon, 9 Nov 2015 16:56:29 +0100 Message-Id: <1447084592-26322-13-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1447084592-26322-1-git-send-email-cornelia.huck@de.ibm.com> References: <1447084592-26322-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH for-2.5 12/15] qdev: provide qdev_reset_all_fn() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, David Hildenbrand From: David Hildenbrand For TYPE_DEVICE, the dc->reset() function is not called on system resets yet. Until that is changed, we have to manually register a reset handler. Let's provide qdev_reset_all_fn(), that can directly be used - just like the reset handler that is already available for qbus. Reviewed-by: Cornelia Huck Signed-off-by: David Hildenbrand Signed-off-by: Cornelia Huck --- hw/core/qdev.c | 5 +++++ include/hw/qdev-core.h | 1 + 2 files changed, 6 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 4ab04aa..b3ad467 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -325,6 +325,11 @@ void qdev_reset_all(DeviceState *dev) qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); } +void qdev_reset_all_fn(void *opaque) +{ + qdev_reset_all(DEVICE(opaque)); +} + void qbus_reset_all(BusState *bus) { qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 8057aed..e6dbde4 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -337,6 +337,7 @@ int qdev_walk_children(DeviceState *dev, void *opaque); void qdev_reset_all(DeviceState *dev); +void qdev_reset_all_fn(void *opaque); /** * @qbus_reset_all: -- 2.6.3