qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, afaerber@suse.de, peter.maydell@linaro.org
Subject: [Qemu-devel] [PATCH memory v3 3/9] qom: Publish object_resolve_link
Date: Sun,  1 Jun 2014 21:15:42 -0700	[thread overview]
Message-ID: <3d40d042b858c49a58360917cb26dd0787d93e5d.1401681566.git.peter.crosthwaite@xilinx.com> (raw)
In-Reply-To: <cover.1401681566.git.peter.crosthwaite@xilinx.com>

The lower level API object_resolve_path is already published to the
world as part of the QOM API. Add object_resolve link as well. This
allows QOM clients to roll their own link property setters without
having to fallback to the less safe object_resolve_path.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 include/qom/object.h | 16 ++++++++++++++++
 qom/object.c         | 13 ++-----------
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/include/qom/object.h b/include/qom/object.h
index a641dcd..7f96ecf 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1048,6 +1048,22 @@ Object *object_resolve_path_type(const char *path, const char *typename,
 Object *object_resolve_path_component(Object *parent, const gchar *part);
 
 /**
+ * object_resolve_link:
+ * @obj: The object containing the link property
+ * @name: Name of the link property
+ * @path: the path to resolve
+ * @errp: Error object to populate in case of error
+ *
+ * Lookup an object and ensure its type matches a link property type.  This
+ * is similar to object_resolve_path() except type verification against the
+ * link property is performed.
+ *
+ * Returns: The matched object or NULL on path lookup failures.
+ */
+Object *object_resolve_link(Object *obj, const char *name,
+                            const char *path, Error **errp);
+
+/**
  * object_property_add_child:
  * @obj: the object to add a property to
  * @name: the name of the property
diff --git a/qom/object.c b/qom/object.c
index ec5adf4..b9b2736 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1058,17 +1058,8 @@ static void object_get_link_property(Object *obj, Visitor *v, void *opaque,
     }
 }
 
-/*
- * object_resolve_link:
- *
- * Lookup an object and ensure its type matches the link property type.  This
- * is similar to object_resolve_path() except type verification against the
- * link property is performed.
- *
- * Returns: The matched object or NULL on path lookup failures.
- */
-static Object *object_resolve_link(Object *obj, const char *name,
-                                   const char *path, Error **errp)
+Object *object_resolve_link(Object *obj, const char *name,
+                            const char *path, Error **errp)
 {
     const char *type;
     gchar *target_type;
-- 
2.0.0

  parent reply	other threads:[~2014-06-02  4:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02  4:13 [Qemu-devel] [PATCH memory v3 0/9] Memory Region QOMification Peter Crosthwaite
2014-06-02  4:14 ` [Qemu-devel] [PATCH memory v3 1/9] memory: Simplify mr_add_subregion() if-else Peter Crosthwaite
2014-06-02  4:15 ` [Qemu-devel] [PATCH memory v3 2/9] qom: object: Ignore refs/unrefs of NULL Peter Crosthwaite
2014-06-02  4:15 ` Peter Crosthwaite [this message]
2014-06-02  4:16 ` [Qemu-devel] [PATCH memory v3 4/9] memory: Coreify subregion add functionality Peter Crosthwaite
2014-06-02  4:16 ` [Qemu-devel] [PATCH memory v3 5/9] memory: MemoryRegion: factor out memory region re-adder Peter Crosthwaite
2014-06-02  4:17 ` [Qemu-devel] [PATCH memory v3 6/9] memory: MemoryRegion: QOMify Peter Crosthwaite
2014-06-02 12:18   ` Peter Maydell
2014-06-02 22:39     ` Peter Crosthwaite
2014-06-02  4:17 ` [Qemu-devel] [PATCH memory v3 7/9] memory: MemoryRegion: Add container and addr props Peter Crosthwaite
2014-06-02  4:18 ` [Qemu-devel] [PATCH memory v3 8/9] memory: MemoryRegion: Add may-overlap and priority props Peter Crosthwaite
2014-06-02  4:19 ` [Qemu-devel] [PATCH memory v3 9/9] memory: MemoryRegion: Add size property Peter Crosthwaite
2014-06-02 14:26 ` [Qemu-devel] [PATCH memory v3 0/9] Memory Region QOMification Peter Maydell
2014-06-02 22:37   ` Peter Crosthwaite

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=3d40d042b858c49a58360917cb26dd0787d93e5d.1401681566.git.peter.crosthwaite@xilinx.com \
    --to=peter.crosthwaite@xilinx.com \
    --cc=afaerber@suse.de \
    --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).