From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39379 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5kTe-0004Yp-48 for qemu-devel@nongnu.org; Fri, 01 Apr 2011 15:57:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5kTd-0001F3-4p for qemu-devel@nongnu.org; Fri, 01 Apr 2011 15:57:50 -0400 Received: from hall.aurel32.net ([88.191.126.93]:57289) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5kTc-0001Ep-Vj for qemu-devel@nongnu.org; Fri, 01 Apr 2011 15:57:49 -0400 Date: Fri, 1 Apr 2011 21:57:46 +0200 From: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH] Register only one qbus_reset_all_fn() for system bus Message-ID: <20110401195746.GB24630@volta.aurel32.net> References: <1298243333-23799-1-git-send-email-dbaryshkov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1298243333-23799-1-git-send-email-dbaryshkov@gmail.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dmitry Eremin-Solenikov Cc: qemu-devel@nongnu.org On Mon, Feb 21, 2011 at 02:08:53AM +0300, Dmitry Eremin-Solenikov wrote: > Currently reset handler is registered for System bus twice: once during > bus creation and once in vl.c. Remove the second qemu_register_reset() > invocation. Also while we are at it, remove incorrect check at > qbus_create_inplace(): when system bus is created, main_system_bus is > NULL (as it's not yet created, it cannot be set), so the check is just > wrong. > > Signed-off-by: Dmitry Eremin-Solenikov > --- > hw/qdev.c | 2 +- > vl.c | 3 --- > 2 files changed, 1 insertions(+), 4 deletions(-) > > diff --git a/hw/qdev.c b/hw/qdev.c > index 1aa1ea0..0a3c8ce 100644 > --- a/hw/qdev.c > +++ b/hw/qdev.c > @@ -762,7 +762,7 @@ void qbus_create_inplace(BusState *bus, BusInfo *info, > if (parent) { > QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling); > parent->num_child_bus++; > - } else if (bus != main_system_bus) { > + } else { > /* TODO: once all bus devices are qdevified, > only reset handler for main_system_bus should be registered here. */ > qemu_register_reset(qbus_reset_all_fn, bus); > diff --git a/vl.c b/vl.c > index 91be92e..24923db 100644 > --- a/vl.c > +++ b/vl.c > @@ -3120,9 +3120,6 @@ int main(int argc, char **argv, char **envp) > exit(1); > } > > - /* TODO: once all bus devices are qdevified, this should be done > - * when bus is created by qdev.c */ > - qemu_register_reset(qbus_reset_all_fn, sysbus_get_default()); > qemu_run_machine_init_done_notifiers(); > > qemu_system_reset(); Have you verified that all bus devices have been qdevified since this code has been added? I wouldn't bet it is the case. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net