Display child and parent names when reparenting occurs.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
qom/object.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/qom/object.c b/qom/object.c
index be700e831f..417fd90aa5 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1683,7 +1683,12 @@ void object_property_add_child(Object *obj, const char *name,
ObjectProperty *op;
if (child->parent != NULL) {
- error_setg(errp, "child object is already parented");
+ error_setg(errp, "child object '%s' is already parented (parent: '%s') "
+ "can not be children '%s' of '%s'",
+ object_get_typename(child),
+ object_get_typename(child->parent),
+ name,
+ object_get_typename(obj));
return;
}
--
2.21.3