aboutsummaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>2014-08-19 23:56:26 -0700
committerAndreas Färber <afaerber@suse.de>2014-09-04 16:14:47 +0200
commit843ef73a690aabbea6a897e86a426ee7554d7aff (patch)
tree76cc5d1ad3c0aa3869a832a1cfb97b185e0b9629 /memory.c
parent339659041f87a76f8b71ad3d12cadfc5f89b4bb3 (diff)
memory: Remove object_property_add_child_array()
Obsoleted by automatic object_property_add() arrayification. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/memory.c b/memory.c
index ef0be1c3aa..1bae951df7 100644
--- a/memory.c
+++ b/memory.c
@@ -876,30 +876,6 @@ static char *memory_region_escape_name(const char *name)
return escaped;
}
-static void object_property_add_child_array(Object *owner,
- const char *name,
- Object *child)
-{
- int i;
- char *base_name = memory_region_escape_name(name);
-
- for (i = 0; ; i++) {
- char *full_name = g_strdup_printf("%s[%d]", base_name, i);
- Error *local_err = NULL;
-
- object_property_add_child(owner, full_name, child, &local_err);
- g_free(full_name);
- if (!local_err) {
- break;
- }
-
- error_free(local_err);
- }
-
- g_free(base_name);
-}
-
-
void memory_region_init(MemoryRegion *mr,
Object *owner,
const char *name,
@@ -917,8 +893,12 @@ void memory_region_init(MemoryRegion *mr,
mr->name = g_strdup(name);
if (name) {
- object_property_add_child_array(owner, name, OBJECT(mr));
+ char *escaped_name = memory_region_escape_name(name);
+ char *name_array = g_strdup_printf("%s[*]", escaped_name);
+ object_property_add_child(owner, name_array, OBJECT(mr), &error_abort);
object_unref(OBJECT(mr));
+ g_free(name_array);
+ g_free(escaped_name);
}
}