From: "Andreas Färber" <afaerber@suse.de>
To: pbonzini@redhat.com, Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH qom-next 7/7] qom: Add QERR_PROPERTY_SET_AFTER_REALIZE
Date: Thu, 07 Jun 2012 21:56:53 +0200 [thread overview]
Message-ID: <4FD10785.8080900@suse.de> (raw)
In-Reply-To: <1339097465-22977-8-git-send-email-afaerber@suse.de>
Am 07.06.2012 21:31, schrieb Andreas Färber:
> From: Peter Maydell <peter.maydell@linaro.org>
>
> Add a new QError QERR_PROPERTY_SET_AFTER_REALIZE for attempts
> to set a QOM or qdev property after the object/device has been
> realized. This allows a slightly more informative diagnostic
> than the previous "Insufficient permission" message.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/qdev-properties.c | 15 ++++++++++-----
> qerror.c | 4 ++++
> qerror.h | 3 +++
> qom/object-properties.c | 24 ++++++++++++++++--------
> qom/object.c | 6 ++++--
> 5 files changed, 37 insertions(+), 15 deletions(-)
[...]
> diff --git a/qom/object.c b/qom/object.c
> index 40bc23a..c8a2cd7 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -817,7 +817,8 @@ void object_property_get(Object *obj, Visitor *v, const char *name,
> }
>
> if (!prop->get) {
> - error_set(errp, QERR_PERMISSION_DENIED);
> + error_set(errp, QERR_PROPERTY_SET_AFTER_REALIZE,
> + object_get_id(obj), name);
> } else {
> prop->get(obj, v, prop->opaque, name, errp);
> }
> @@ -832,7 +833,8 @@ void object_property_set(Object *obj, Visitor *v, const char *name,
> }
>
> if (!prop->set) {
> - error_set(errp, QERR_PERMISSION_DENIED);
> + error_set(errp, QERR_PROPERTY_SET_AFTER_REALIZE,
> + object_get_id(obj), name);
> } else {
> prop->set(obj, v, prop->opaque, name, errp);
> }
Hm, what does the lack of a setter have to do with realize? :)
Reverting these two hunks.
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-06-07 19:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 19:30 [Qemu-devel] [PATCH qom-next 0/7] QOM realize, revised Andreas Färber
2012-06-07 19:30 ` [Qemu-devel] [PATCH qom-next 1/7] qdev: Push state up to Object Andreas Färber
2012-06-08 1:19 ` Anthony Liguori
2012-06-10 15:49 ` Paolo Bonzini
2012-06-10 17:35 ` Anthony Liguori
2012-06-10 17:38 ` Andreas Färber
2012-06-11 8:25 ` Kevin Wolf
2012-06-11 13:21 ` Anthony Liguori
2012-06-11 14:38 ` Kevin Wolf
2012-06-11 21:31 ` Andreas Färber
2012-06-11 21:43 ` Andreas Färber
2012-06-11 21:48 ` Anthony Liguori
2012-06-12 0:14 ` Andreas Färber
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 2/7] qom: Add get_id Andreas Färber
2012-06-08 1:22 ` Anthony Liguori
2012-06-08 7:11 ` Andreas Färber
2012-06-08 7:44 ` Anthony Liguori
2012-06-08 8:17 ` Andreas Färber
2012-06-08 10:59 ` [Qemu-devel] [libvirt] " Daniel P. Berrange
2012-06-08 11:58 ` [Qemu-devel] " Eric Blake
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 3/7] qdev: Generalize properties to Objects Andreas Färber
2012-06-08 1:23 ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 4/7] qdev: Move bulk of qdev-properties.c to qom/object-properties.c Andreas Färber
2012-06-07 23:23 ` Paolo Bonzini
2012-06-08 1:26 ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 5/7] qom: Push static properties to Object Andreas Färber
2012-06-08 1:26 ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 6/7] qom: Add "realized" property Andreas Färber
2012-06-08 1:26 ` Anthony Liguori
2012-06-07 19:31 ` [Qemu-devel] [PATCH qom-next 7/7] qom: Add QERR_PROPERTY_SET_AFTER_REALIZE Andreas Färber
2012-06-07 19:56 ` Andreas Färber [this message]
2012-06-07 23:22 ` [Qemu-devel] [PATCH qom-next 0/7] QOM realize, revised Paolo Bonzini
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=4FD10785.8080900@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--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 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).