[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH memory v4 04/10] qom: Publish object_resolve_link
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH memory v4 04/10] qom: Publish object_resolve_link |
Date: |
Thu, 5 Jun 2014 23:14:10 -0700 |
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 <address@hidden>
---
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 f8ab845..029acd8 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1097,6 +1097,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 6813aba..185d54b 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1072,17 +1072,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
- [Qemu-devel] [PATCH memory v4 00/10] Memory Region QOMification, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 01/10] memory: Simplify mr_add_subregion() if-else, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 02/10] qom: add a generic mechanism to resolve paths, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 03/10] qom: object: Ignore refs/unrefs of NULL, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 04/10] qom: Publish object_resolve_link,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH memory v4 05/10] memory: Coreify subregion add functionality, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 06/10] memory: MemoryRegion: factor out memory region re-adder, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 07/10] memory: MemoryRegion: QOMify, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 08/10] memory: MemoryRegion: Add container and addr props, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 09/10] memory: MemoryRegion: Add may-overlap and priority props, Peter Crosthwaite, 2014/06/06
- [Qemu-devel] [PATCH memory v4 10/10] memory: MemoryRegion: Add size property, Peter Crosthwaite, 2014/06/06
- Re: [Qemu-devel] [PATCH memory v4 00/10] Memory Region QOMification, Paolo Bonzini, 2014/06/06