From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
qemu-devel@nongnu.org, "Don Slutz" <dslutz@verizon.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Igor Mammedov" <imammedo@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH] qdev: Don't abort() in case globals can't be set
Date: Sun, 8 Jun 2014 13:48:25 +0300 [thread overview]
Message-ID: <20140608104825.GC26245@redhat.com> (raw)
In-Reply-To: <20140607012615.GL15000@otherpad.lan.raisama.net>
On Fri, Jun 06, 2014 at 10:26:15PM -0300, Eduardo Habkost wrote:
> It would be much better if we didn't terminate QEMU inside
> device_post_init(), but at least exiting cleanly is better than aborting
> and dumping core.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/core/qdev.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index e65a5aa..74862c2 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -901,7 +901,13 @@ static void device_initfn(Object *obj)
>
> static void device_post_init(Object *obj)
> {
> - qdev_prop_set_globals(DEVICE(obj), &error_abort);
> + Error *err = NULL;
> + qdev_prop_set_globals(DEVICE(obj), &err);
> + if (err) {
> + qerror_report_err(err);
> + error_free(err);
> + exit(EXIT_FAILURE);
> + }
> }
>
> /* Unlink device from bus and free the structure. */
> --
> 1.9.0
next prev parent reply other threads:[~2014-06-08 10:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 20:14 [Qemu-devel] [PATCH] qdev: Skip non-existing properties when setting globals Eduardo Habkost
2014-06-06 21:06 ` Don Slutz
2014-06-06 21:38 ` Igor Mammedov
2014-06-06 22:21 ` Eduardo Habkost
2014-06-06 23:22 ` Igor Mammedov
2014-06-06 23:45 ` Peter Maydell
2014-06-07 1:09 ` Eduardo Habkost
2014-06-07 1:26 ` [Qemu-devel] [PATCH] qdev: Don't abort() in case globals can't be set Eduardo Habkost
2014-06-08 10:48 ` Michael S. Tsirkin [this message]
2014-06-09 13:00 ` Igor Mammedov
2014-06-07 8:55 ` [Qemu-devel] [PATCH] qdev: Skip non-existing properties when setting globals Peter Maydell
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=20140608104825.GC26245@redhat.com \
--to=mst@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=dslutz@verizon.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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.