From: Roman Kagan <rkagan@virtuozzo.com>
To: "qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "Amit Shah" <amit@kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Fam Zheng" <fam@euphon.net>,
"Markus Armbruster" <armbru@redhat.com>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [RFC PATCH 1/5] qom: preserve get/set presence in aliased properties
Date: Fri, 14 Dec 2018 16:57:06 +0000 [thread overview]
Message-ID: <20181214165657.749-2-rkagan@virtuozzo.com> (raw)
In-Reply-To: <20181214165657.749-1-rkagan@virtuozzo.com>
Usually in order to tell if a property is read-only, write-only, or
read-write, one has to look at whether it has .get or .set methods.
However, property aliases are always defined with both, and it's not
until the call to the getter or setter when the support for the
corresponding operation can be found out.
To make it easier to determine if an operation is supported for an alias
property, only assign it getter and setter if the target property has
the corresponding method.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
qom/object.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index 17921c0a71..b362ebab19 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2382,8 +2382,8 @@ void object_property_add_alias(Object *obj, const char *name,
prop->target_name = g_strdup(target_name);
op = object_property_add(obj, name, prop_type,
- property_get_alias,
- property_set_alias,
+ target_prop->get ? property_get_alias : NULL,
+ target_prop->set ? property_set_alias : NULL,
property_release_alias,
prop, &local_err);
if (local_err) {
--
2.19.2
next prev parent reply other threads:[~2018-12-14 16:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-14 16:57 [Qemu-devel] [RFC PATCH 0/5] expose negotiated virtio features in r/o properties Roman Kagan
2018-12-14 16:57 ` Roman Kagan [this message]
2018-12-14 16:57 ` [Qemu-devel] [RFC PATCH 2/5] qmp: further consolidate listing of device and object properties Roman Kagan
2018-12-14 16:57 ` [Qemu-devel] [RFC PATCH 3/5] qdev-properties: add r/o 64bit bitfield property Roman Kagan
2018-12-14 16:57 ` [Qemu-devel] [RFC PATCH 4/5] virtio: drop DEFINE_VIRTIO_COMMON_FEATURES Roman Kagan
2018-12-14 16:57 ` [Qemu-devel] [RFC PATCH 5/5] virtio: expose negotiated features in r/o properties Roman Kagan
2018-12-23 11:05 ` [Qemu-devel] [RFC PATCH 0/5] expose negotiated virtio " no-reply
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=20181214165657.749-2-rkagan@virtuozzo.com \
--to=rkagan@virtuozzo.com \
--cc=afaerber@suse.de \
--cc=amit@kernel.org \
--cc=armbru@redhat.com \
--cc=fam@euphon.net \
--cc=mst@redhat.com \
--cc=pbonzini@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).