diff options
author | Paolo Bonzini | 2012-02-03 11:21:01 +0100 |
---|---|---|
committer | Paolo Bonzini | 2012-02-07 13:52:41 +0100 |
commit | 02fe2db6312ff894be9aa0b862b383cc9d94505a (patch) | |
tree | 7368f911621092847d83d481837a587577a6cc8b /include/qemu/object.h | |
parent | qom: fix off-by-one (diff) | |
download | qemu-02fe2db6312ff894be9aa0b862b383cc9d94505a.tar.gz qemu-02fe2db6312ff894be9aa0b862b383cc9d94505a.tar.xz qemu-02fe2db6312ff894be9aa0b862b383cc9d94505a.zip |
qom: add object_resolve_path_type
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qemu/object.h')
-rw-r--r-- | include/qemu/object.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/include/qemu/object.h b/include/qemu/object.h index b27f80e0bd..6c36345814 100644 --- a/include/qemu/object.h +++ b/include/qemu/object.h @@ -749,14 +749,35 @@ gchar *object_get_canonical_path(Object *obj); * specifying objects easy. At each level of the composition tree, the partial * path is matched as an absolute path. The first match is not returned. At * least two matches are searched for. A successful result is only returned if - * only one match is founded. If more than one match is found, a flag is - * return to indicate that the match was ambiguous. + * only one match is found. If more than one match is found, a flag is + * returned to indicate that the match was ambiguous. * * Returns: The matched object or NULL on path lookup failure. */ Object *object_resolve_path(const char *path, bool *ambiguous); /** + * object_resolve_path_type: + * @path: the path to resolve + * @typename: the type to look for. + * @ambiguous: returns true if the path resolution failed because of an + * ambiguous match + * + * This is similar to object_resolve_path. However, when looking for a + * partial path only matches that implement the given type are considered. + * This restricts the search and avoids spuriously flagging matches as + * ambiguous. + * + * For both partial and absolute paths, the return value goes through + * a dynamic cast to @typename. This is important if either the link, + * or the typename itself are of interface types. + * + * Returns: The matched object or NULL on path lookup failure. + */ +Object *object_resolve_path_type(const char *path, const char *typename, + bool *ambiguous); + +/** * object_property_add_child: * @obj: the object to add a property to * @name: the name of the property |