All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>,
	qemu-devel@nongnu.org, "Don Slutz" <dslutz@verizon.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] Should not abort on -global <nonexistant dev prop>
Date: Fri, 06 Jun 2014 10:01:34 +0200	[thread overview]
Message-ID: <5391755E.9070507@redhat.com> (raw)
In-Reply-To: <87wqcuzf8z.fsf_-_@blackfin.pond.sub.org>

Il 06/06/2014 09:09, Markus Armbruster ha scritto:
> Looks like this regressed in Eduardo's commit 99a0b03 qdev: Set globals
> in instance_post_init function.
>
> Before, we exited cleanly on this error, in device_initfn():
>
>         qdev_prop_set_globals(dev, &err);
>         if (err != NULL) {
>             qerror_report_err(err);
>             error_free(err);
>             exit(1);
>         }

Hmm, right.  I had noticed this abort in the past, but I wasn't sure if 
it was a regression or not.

However, the above is not hotplug-friendly either.  In this sense, I 
prefer an assertion that clearly says "gotta fix something here".

> The commit asserts qdev_prop_set_globals() can't fail, which is wrong.
>
>     static void device_post_init(Object *obj)
>     {
>         DeviceState *dev = DEVICE(obj);
>         Error *err = NULL;
>
>         qdev_prop_set_globals(dev, &err);
>         assert_no_error(err);
>     }
>
> Later simplified to:
>
>     static void device_post_init(Object *obj)
>     {
>         qdev_prop_set_globals(DEVICE(obj), &error_abort);
>     }

I think the bug is that the global property should have been filtered 
out early.  Or alternatively we need something better than 
device_post_init to set the globals... no ideas for now.

Paolo

  reply	other threads:[~2014-06-06  8:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 18:03 [Qemu-devel] [PATCH v4 0/2] qdev: Display warning about unused -global Don Slutz
2014-05-05 18:03 ` [Qemu-devel] [PATCH v4 1/2] " Don Slutz
2014-06-06  7:09   ` [Qemu-devel] Should not abort on -global <nonexistant dev prop> (was: [PATCH v4 1/2] qdev: Display warning about unused -global) Markus Armbruster
2014-06-06  8:01     ` Paolo Bonzini [this message]
2014-06-06 19:11       ` [Qemu-devel] Should not abort on -global <nonexistant dev prop> Eduardo Habkost
2014-05-05 18:03 ` [Qemu-devel] [PATCH v4 2/2] qdev: Add test of qdev_prop_check_global Don Slutz
2014-06-05 16:06 ` [Qemu-devel] [ping PATCH v4 0/2] qdev: Display warning about unused -global Don Slutz
2014-06-05 16:21 ` [Qemu-devel] [PATCH " Michael S. Tsirkin

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=5391755E.9070507@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=dslutz@verizon.com \
    --cc=ehabkost@redhat.com \
    --cc=mst@redhat.com \
    --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.