Skip to content

Commit f6f0284

Browse files
xzpeterphilmd
authored andcommitted
qom: Remove container_get()
Now there's no user of container_get(), remove it. Signed-off-by: Peter Xu <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]>
1 parent d3176a9 commit f6f0284

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

include/qom/object.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,17 +2017,6 @@ int object_child_foreach(Object *obj, int (*fn)(Object *child, void *opaque),
20172017
int object_child_foreach_recursive(Object *obj,
20182018
int (*fn)(Object *child, void *opaque),
20192019
void *opaque);
2020-
/**
2021-
* container_get:
2022-
* @root: root of the #path, e.g., object_get_root()
2023-
* @path: path to the container
2024-
*
2025-
* Return a container object whose path is @path. Create more containers
2026-
* along the path if necessary.
2027-
*
2028-
* Returns: the container object.
2029-
*/
2030-
Object *container_get(Object *root, const char *path);
20312020

20322021
/**
20332022
* object_property_add_new_container:

qom/container.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,4 @@ Object *object_property_add_new_container(Object *obj, const char *name)
3434
return child;
3535
}
3636

37-
Object *container_get(Object *root, const char *path)
38-
{
39-
Object *obj, *child;
40-
char **parts;
41-
int i;
42-
43-
parts = g_strsplit(path, "/", 0);
44-
assert(parts != NULL && parts[0] != NULL && !parts[0][0]);
45-
obj = root;
46-
47-
for (i = 1; parts[i] != NULL; i++, obj = child) {
48-
child = object_resolve_path_component(obj, parts[i]);
49-
if (!child) {
50-
child = object_property_add_new_container(obj, parts[i]);
51-
}
52-
}
53-
54-
g_strfreev(parts);
55-
56-
return obj;
57-
}
58-
59-
6037
type_init(container_register_types)

0 commit comments

Comments
 (0)