diff options
author | Peter Crosthwaite <peter.crosthwaite@xilinx.com> | 2014-08-19 23:56:26 -0700 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-09-04 16:14:47 +0200 |
commit | 843ef73a690aabbea6a897e86a426ee7554d7aff (patch) | |
tree | 76cc5d1ad3c0aa3869a832a1cfb97b185e0b9629 | |
parent | 339659041f87a76f8b71ad3d12cadfc5f89b4bb3 (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>
-rw-r--r-- | memory.c | 30 |
1 files changed, 5 insertions, 25 deletions
@@ -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); } } |