From patchwork Mon Nov 9 15:56:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 541809 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 03A101402B3 for ; Tue, 10 Nov 2015 02:57:47 +1100 (AEDT) Received: from localhost ([::1]:53577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvopF-0008As-0z for incoming@patchwork.ozlabs.org; Mon, 09 Nov 2015 10:57:45 -0500 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 d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 9 Nov 2015 15:56:56 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: cornelia.huck@de.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org 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 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-100.boeblingen.de.ibm.com [9.152.224.100]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tA9Fulw0025639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 9 Nov 2015 08:56:54 -0700 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Mon, 9 Nov 2015 16:56:29 +0100 Message-Id: <1447084592-26322-13-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 2.6.3 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> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15110915-0009-0000-0000-00000697A418 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 195.75.94.108 Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de, David Hildenbrand Subject: [Qemu-devel] [PATCH for-2.5 12/15] qdev: provide qdev_reset_all_fn() 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: 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: