qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH 1/7] qom: Make link property API public
Date: Wed, 28 Jun 2017 20:48:44 +0800	[thread overview]
Message-ID: <20170628124850.12821-2-famz@redhat.com> (raw)
In-Reply-To: <20170628124850.12821-1-famz@redhat.com>

The get/set pair and the struct will be reused by qdev link prop, make
them public.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 include/qom/object.h | 13 +++++++++++++
 qom/object.c         | 18 ++++++------------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index abaeb8c..4659e6a 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1613,4 +1613,17 @@ Object *container_get(Object *root, const char *path);
  * Returns the instance_size of the given @typename.
  */
 size_t object_type_get_instance_size(const char *typename);
+
+typedef struct {
+    Object **child;
+    void (*check)(Object *, const char *, Object *, Error **);
+    ObjectPropertyLinkFlags flags;
+} LinkProperty;
+
+void object_get_link_property(Object *obj, Visitor *v,
+                              const char *name, void *opaque,
+                              Error **errp);
+void object_set_link_property(Object *obj, Visitor *v,
+                              const char *name, void *opaque,
+                              Error **errp);
 #endif
diff --git a/qom/object.c b/qom/object.c
index 5f6fdfa..3868370 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1434,15 +1434,9 @@ void object_property_allow_set_link(Object *obj, const char *name,
     /* Allow the link to be set, always */
 }
 
-typedef struct {
-    Object **child;
-    void (*check)(Object *, const char *, Object *, Error **);
-    ObjectPropertyLinkFlags flags;
-} LinkProperty;
-
-static void object_get_link_property(Object *obj, Visitor *v,
-                                     const char *name, void *opaque,
-                                     Error **errp)
+void object_get_link_property(Object *obj, Visitor *v,
+                              const char *name, void *opaque,
+                              Error **errp)
 {
     LinkProperty *lprop = opaque;
     Object **child = lprop->child;
@@ -1498,9 +1492,9 @@ static Object *object_resolve_link(Object *obj, const char *name,
     return target;
 }
 
-static void object_set_link_property(Object *obj, Visitor *v,
-                                     const char *name, void *opaque,
-                                     Error **errp)
+void object_set_link_property(Object *obj, Visitor *v,
+                              const char *name, void *opaque,
+                              Error **errp)
 {
     Error *local_err = NULL;
     LinkProperty *prop = opaque;
-- 
2.9.4

  reply	other threads:[~2017-06-28 12:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-28 12:48 [Qemu-devel] [PATCH 0/7] qdev: Introduce DEFINE_PROP_LINK Fam Zheng
2017-06-28 12:48 ` Fam Zheng [this message]
2017-06-28 13:32   ` [Qemu-devel] [PATCH 1/7] qom: Make link property API public Paolo Bonzini
2017-06-28 13:36     ` Andreas Färber
2017-06-28 14:09       ` Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 2/7] qom: Handle property lookup failure in object_resolve_link Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 3/7] qom: Save type name in LinkProperty Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 4/7] qdev: Introduce DEFINE_PROP_LINK Fam Zheng
2017-06-28 13:38   ` Paolo Bonzini
2017-06-28 14:02     ` Fam Zheng
2017-06-28 14:06       ` Paolo Bonzini
2017-06-28 14:32         ` Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 5/7] virtio-blk: Use DEFINE_PROP_LINK Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 6/7] virtio-scsi: " Fam Zheng
2017-06-28 12:48 ` [Qemu-devel] [PATCH 7/7] virtio-rng: " Fam Zheng

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=20170628124850.12821-2-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=dgilbert@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).