From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40465) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrJiJ-0003RK-D5 for qemu-devel@nongnu.org; Mon, 02 Jun 2014 00:19:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrJiD-0001pw-6S for qemu-devel@nongnu.org; Mon, 02 Jun 2014 00:19:11 -0400 Received: from mail-qg0-f47.google.com ([209.85.192.47]:64666) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrJiD-0001pp-3O for qemu-devel@nongnu.org; Mon, 02 Jun 2014 00:19:05 -0400 Received: by mail-qg0-f47.google.com with SMTP id j107so9735260qga.6 for ; Sun, 01 Jun 2014 21:19:04 -0700 (PDT) Sender: Peter Crosthwaite From: Peter Crosthwaite Date: Sun, 1 Jun 2014 21:15:42 -0700 Message-Id: <3d40d042b858c49a58360917cb26dd0787d93e5d.1401681566.git.peter.crosthwaite@xilinx.com> In-Reply-To: References: Subject: [Qemu-devel] [PATCH memory v3 3/9] qom: Publish object_resolve_link List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, afaerber@suse.de, peter.maydell@linaro.org 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 --- 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