[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 10/13] qom: catch errors in object_property_add_child
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PULL 10/13] qom: catch errors in object_property_add_child |
Date: |
Wed, 18 Dec 2013 12:00:00 -0500 |
From: Paolo Bonzini <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-By: Igor Mammedov <address@hidden>
Signed-off-by: Luiz Capitulino <address@hidden>
---
qom/object.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index fc19cf6..68fe07a 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -988,17 +988,22 @@ static void object_finalize_child_property(Object *obj,
const char *name,
void object_property_add_child(Object *obj, const char *name,
Object *child, Error **errp)
{
+ Error *local_err = NULL;
gchar *type;
type = g_strdup_printf("child<%s>", object_get_typename(OBJECT(child)));
object_property_add(obj, name, type, object_get_child_property,
- NULL, object_finalize_child_property, child, errp);
-
+ NULL, object_finalize_child_property, child,
&local_err);
+ if (error_is_set(&local_err)) {
+ error_propagate(errp, local_err);
+ goto out;
+ }
object_ref(child);
g_assert(child->parent == NULL);
child->parent = obj;
+out:
g_free(type);
}
--
1.8.1.4
- [Qemu-devel] [PULL 13/13] qemu-monitor: HMP cpu-add wrapper, (continued)
- [Qemu-devel] [PULL 13/13] qemu-monitor: HMP cpu-add wrapper, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 01/13] vl: add missing transition debug->finish_migrate, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 06/13] qemu-option: Remove qemu_opts_create_nofail, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 03/13] hw/core/qdev: Delete dead code, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 02/13] error: Add error_abort, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 04/13] hw: Remove assert_no_error usages, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 08/13] rng: initialize file descriptor to -1, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 09/13] qom: fix leak for objects created with -object, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 05/13] target-i386: Remove assert_no_error usage, Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 07/13] qerror: Remove assert_no_error(), Luiz Capitulino, 2013/12/18
- [Qemu-devel] [PULL 10/13] qom: catch errors in object_property_add_child,
Luiz Capitulino <=
- Re: [Qemu-devel] [PULL 00/13] QMP queue, Peter Maydell, 2013/12/19
- Re: [Qemu-devel] [PULL 00/13] QMP queue, Anthony Liguori, 2013/12/19