From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qj0DP-0006eK-HI for qemu-devel@nongnu.org; Mon, 18 Jul 2011 22:39:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qj0DL-0007SY-OZ for qemu-devel@nongnu.org; Mon, 18 Jul 2011 22:39:19 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:33094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qj0DL-0007SD-GW for qemu-devel@nongnu.org; Mon, 18 Jul 2011 22:39:15 -0400 Date: Tue, 19 Jul 2011 11:39:10 +0900 From: Isaku Yamahata Message-ID: <20110719023910.GC25737@valinux.co.jp> References: <1311020546-9769-1-git-send-email-weil@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1311020546-9769-1-git-send-email-weil@mail.berlios.de> Subject: Re: [Qemu-devel] [PATCH] Fix duplicate device reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: qemu-devel@nongnu.org Thank you for addressing this. Similar patches were proposed and weren't merged unfortunately. The reason why the qdev_register_reset() in vl.c is to keep the reset order. The reset for main_system_bus shouldn't registered by qbus_create_inplace(). But the check, bus != main_system_bus, doesn't work as intended because main_system_bus is NULL in early qdev creation. So there are possible ways for the fix. - Don't care the reset order your patch + remove "if (bus != main_system_bus)" in qbus_create_inplace() - keep the reset order - instantiate main_system_bus early. So the check, bus != main_system_bus in qbus_create_inplace(), will work. or - fix the check, bus != main_system_bus in qbus_create_inplace(), somehow thanks, On Mon, Jul 18, 2011 at 10:22:26PM +0200, Stefan Weil wrote: > qbus_reset_all_fn was registered twice, so a lot of device reset > functions were also called twice when QEMU started. > > It is sufficient to call sysbus_get_default() which will > register qbus_reset_all_fn. > > Signed-off-by: Stefan Weil > --- > vl.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/vl.c b/vl.c > index fcd7395..fb2f6db 100644 > --- a/vl.c > +++ b/vl.c > @@ -3301,7 +3301,7 @@ int main(int argc, char **argv, char **envp) > > /* 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()); > + sysbus_get_default(); > qemu_run_machine_init_done_notifiers(); > > qemu_system_reset(VMRESET_SILENT); > -- > 1.7.2.5 > -- yamahata