Received: from eggs.gnu.org ([2001:4830:134:3::10]:43281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwZds-00065P-3r for qemu-devel@nongnu.org; Wed, 11 Nov 2015 12:57:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwZdT-0004ke-Bk for qemu-devel@nongnu.org; Wed, 11 Nov 2015 12:57:08 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:33715) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwZdT-0004jq-1L for qemu-devel@nongnu.org; Wed, 11 Nov 2015 12:56:43 -0500 Received: from localhost by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 11 Nov 2015 17:56:42 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B7B2717D8056 for ; Wed, 11 Nov 2015 17:56:58 +0000 (GMT) Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tABHudLc50987104 for ; Wed, 11 Nov 2015 17:56:39 GMT Received: from d06av10.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tABGueVJ015041 for ; Wed, 11 Nov 2015 09:56:40 -0700 From: Cornelia Huck Date: Wed, 11 Nov 2015 18:56:30 +0100 Message-Id: <1447264593-14625-13-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1447264593-14625-1-git-send-email-cornelia.huck@de.ibm.com> References: <1447264593-14625-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL for-2.5 12/15] qdev: provide qdev_reset_all_fn() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: borntraeger@de.ibm.com, qemu-devel@nongnu.org, agraf@suse.de, David Hildenbrand , jfrei@linux.vnet.ibm.com, Cornelia Huck 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