From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: imammedo@redhat.com, mst@redhat.com, afaerber@suse.de,
ehabkost@redhat.com
Subject: Re: [Qemu-devel] [PATCH] qdev: Don't exit when running into bad -global
Date: Tue, 20 Jan 2015 10:02:28 -0700 [thread overview]
Message-ID: <54BE8A24.10906@redhat.com> (raw)
In-Reply-To: <1421744647-26844-1-git-send-email-armbru@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]
On 01/20/2015 02:04 AM, Markus Armbruster wrote:
> -global lets you set a nice booby-trap for yourself:
>
> $ qemu-system-x86_64 -nodefaults -S -display none -usb -monitor stdio -global usb-mouse.usb_version=l
> QEMU 2.1.94 monitor - type 'help' for more information
> (qemu) device_add usb-mouse
> Parameter 'usb_version' expects an int64 value or range
> $ echo $?
> 1
>
> Not nice. Until commit 3196270 we even abort()ed.
>
> This is consistent with how we handle similarly unusable -global in
> qdev_prop_check_globals().
>
> You could argue that the error should make device_add fail. Would be
> harder, because we're running within TypeInfo's instance_post_init()
> method device_post_init(), which can't fail.
I agree that outputting a warning up front then ignoring the bogus
value, is as good as we can do given we are under "can't fail"
constraints, and much better than confusingly failing down the road.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> hw/core/qdev-properties.c | 21 +++++++++------------
> hw/core/qdev.c | 8 +-------
> include/hw/qdev-properties.h | 4 +---
> 3 files changed, 11 insertions(+), 22 deletions(-)
>
> -void qdev_prop_set_globals_for_type(DeviceState *dev, const char *typename,
> - Error **errp)
> +static void qdev_prop_set_globals_for_type(DeviceState *dev,
> + const char *typename)
Is the indentation off here?
But that's minor, so:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2015-01-20 17:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-20 9:04 [Qemu-devel] [PATCH] qdev: Don't exit when running into bad -global Markus Armbruster
2015-01-20 17:02 ` Eric Blake [this message]
2015-01-20 20:14 ` Markus Armbruster
2015-01-26 18:51 ` Eduardo Habkost
2015-02-05 12:06 ` 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=54BE8A24.10906@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=imammedo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).