mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-12 23:58:38 +00:00
qom: allow object_get_canonical_path_component without parent
Just return NULL; any callers that cause a change in behavior would have caused an assertion failure before, so this is safe. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
82870f3c02
commit
770dec2627
@ -1302,6 +1302,7 @@ Object *object_get_internal_root(void);
|
|||||||
*
|
*
|
||||||
* Returns: The final component in the object's canonical path. The canonical
|
* Returns: The final component in the object's canonical path. The canonical
|
||||||
* path is the path within the composition tree starting from the root.
|
* path is the path within the composition tree starting from the root.
|
||||||
|
* %NULL if the object doesn't have a parent (and thus a canonical path).
|
||||||
*/
|
*/
|
||||||
gchar *object_get_canonical_path_component(Object *obj);
|
gchar *object_get_canonical_path_component(Object *obj);
|
||||||
|
|
||||||
|
@ -1644,8 +1644,9 @@ gchar *object_get_canonical_path_component(Object *obj)
|
|||||||
ObjectProperty *prop = NULL;
|
ObjectProperty *prop = NULL;
|
||||||
GHashTableIter iter;
|
GHashTableIter iter;
|
||||||
|
|
||||||
g_assert(obj);
|
if (obj->parent == NULL) {
|
||||||
g_assert(obj->parent != NULL);
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
g_hash_table_iter_init(&iter, obj->parent->properties);
|
g_hash_table_iter_init(&iter, obj->parent->properties);
|
||||||
while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&prop)) {
|
while (g_hash_table_iter_next(&iter, NULL, (gpointer *)&prop)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user