From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52856) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVa-0000ty-Dx for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkdVZ-0008Kd-8G for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:38 -0500 Received: from mail-ia0-f173.google.com ([209.85.210.173]:55348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkdVZ-0008KZ-3i for qemu-devel@nongnu.org; Mon, 17 Dec 2012 11:25:37 -0500 Received: by mail-ia0-f173.google.com with SMTP id w21so5710255iac.4 for ; Mon, 17 Dec 2012 08:25:36 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 17 Dec 2012 17:24:45 +0100 Message-Id: <1355761490-10073-11-git-send-email-pbonzini@redhat.com> In-Reply-To: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> References: <1355761490-10073-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 10/15] qdev: switch reset to post-order List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com Post-order is the only sensible direction for the reset signals. For example, suppose pre-order is used and the parent has some data structures that cache children state (for example a list of active requests). When the reset method is invoked on the parent, these caches cannot be left in a consistent state, nor asserted to be in a consistent state. If post-order is used, on the other hand, these will be in a known state when the reset method is invoked on the parent. I checked the existing bus-reset implementation and they are all fine with post-order. USB doesn't use qdev reset, but it should be fine with post-order too. Signed-off-by: Paolo Bonzini --- hw/qdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 457f7bf..833d571 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -227,12 +227,12 @@ static int qbus_reset_one(BusState *bus, void *opaque) void qdev_reset_all(DeviceState *dev) { - qdev_walk_children(dev, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); + qdev_walk_children(dev, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); } void qbus_reset_all(BusState *bus) { - qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL, NULL, NULL); + qbus_walk_children(bus, NULL, NULL, qdev_reset_one, qbus_reset_one, NULL); } void qbus_reset_all_fn(void *opaque) -- 1.8.0.2