From: Anthony Liguori <anthony@codemonkey.ws>
To: Isaku Yamahata <yamahata@valinux.co.jp>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qdev: Eliminate duplicate reset
Date: Fri, 05 Aug 2011 11:46:47 -0500 [thread overview]
Message-ID: <4E3C1E77.20101@codemonkey.ws> (raw)
In-Reply-To: <223cb297ff4e241918cf991d3f0e65b63d12e7a8.1312250299.git.yamahata@valinux.co.jp>
On 08/01/2011 08:59 PM, Isaku Yamahata wrote:
> qbus_reset_all_fn was registered twice, so a lot of device reset
> functions were also called twice when QEMU started.
> Which was introduced by 80376c3fc2c38fdd45354e4b0eb45031f35587ed
> This patch fixes it by making the main_system_bus creation not register
> reset handler.
>
> Cc: Stefan Weil<weil@mail.berlios.de>
> Signed-off-by: Isaku Yamahata<yamahata@valinux.co.jp>
> Tested-by: Stefan Weil<weil@mail.berlios.de>
Applied. Thanks.
Regards,
Anthony Liguori
> ---
> hw/qdev.c | 14 ++++++++++++--
> 1 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index b4ea8e1..6819537 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -36,6 +36,7 @@ static bool qdev_hot_removed = false;
>
> /* This is a nasty hack to allow passing a NULL bus to qdev_create. */
> static BusState *main_system_bus;
> +static void main_system_bus_create(void);
>
> DeviceInfo *device_info_list;
>
> @@ -328,8 +329,7 @@ static int qdev_reset_one(DeviceState *dev, void *opaque)
> BusState *sysbus_get_default(void)
> {
> if (!main_system_bus) {
> - main_system_bus = qbus_create(&system_bus_info, NULL,
> - "main-system-bus");
> + main_system_bus_create();
> }
> return main_system_bus;
> }
> @@ -784,6 +784,16 @@ BusState *qbus_create(BusInfo *info, DeviceState *parent, const char *name)
> return bus;
> }
>
> +static void main_system_bus_create(void)
> +{
> + /* assign main_system_bus before qbus_create_inplace()
> + * in order to make "if (bus != main_system_bus)" work */
> + main_system_bus = qemu_mallocz(system_bus_info.size);
> + main_system_bus->qdev_allocated = 1;
> + qbus_create_inplace(main_system_bus,&system_bus_info, NULL,
> + "main-system-bus");
> +}
> +
> void qbus_free(BusState *bus)
> {
> DeviceState *dev;
prev parent reply other threads:[~2011-08-05 16:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-02 1:59 [Qemu-devel] [PATCH] qdev: Eliminate duplicate reset Isaku Yamahata
2011-08-05 16:46 ` Anthony Liguori [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E3C1E77.20101@codemonkey.ws \
--to=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.