@@ -25,7 +25,8 @@ typedef struct TypeInfo TypeInfo;
typedef struct InterfaceClass InterfaceClass;
typedef struct InterfaceInfo InterfaceInfo;
-#define TYPE_OBJECT "object"
+#define TYPE_OBJECT "object"
+#define TYPE_CONTAINER "container"
typedef struct ObjectProperty ObjectProperty;
@@ -1053,7 +1053,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
flash_size = (((board->dc0 & 0xffff) + 1) << 1) * 1024;
sram_size = ((board->dc0 >> 18) + 1) * 1024;
- soc_container = object_new("container");
+ soc_container = object_new(TYPE_CONTAINER);
object_property_add_child(OBJECT(ms), "soc", soc_container);
/* Flash programming is done via the SCU, so pretend it is ROM. */
@@ -15,7 +15,7 @@
#include "qemu/module.h"
static const TypeInfo container_info = {
- .name = "container",
+ .name = TYPE_CONTAINER,
.parent = TYPE_OBJECT,
};
@@ -37,7 +37,7 @@ Object *container_get(Object *root, const char *path)
for (i = 1; parts[i] != NULL; i++, obj = child) {
child = object_resolve_path_component(obj, parts[i]);
if (!child) {
- child = object_new("container");
+ child = object_new(TYPE_CONTAINER);
object_property_add_child(obj, parts[i], child);
object_unref(child);
}
@@ -1739,7 +1739,7 @@ Object *object_get_root(void)
static Object *root;
if (!root) {
- root = object_new("container");
+ root = object_new(TYPE_CONTAINER);
}
return root;
@@ -1755,7 +1755,7 @@ Object *object_get_internal_root(void)
static Object *internal_root;
if (!internal_root) {
- internal_root = object_new("container");
+ internal_root = object_new(TYPE_CONTAINER);
}
return internal_root;
Provide a macro for the container type across QEMU source tree, rather than hard code it every time. Signed-off-by: Peter Xu <peterx@redhat.com> --- include/qom/object.h | 3 ++- hw/arm/stellaris.c | 2 +- qom/container.c | 4 ++-- qom/object.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-)