From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
qemu-trivial@nongnu.org, "Michael Tokarev" <mjt@tls.msk.ru>,
"Markus Armbruster" <armbru@redhat.com>,
"Laurent Vivier" <laurent@vivier.eu>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>
Subject: [PATCH 3/3] qom/object: Make reparenting error more verbose
Date: Mon, 4 May 2020 10:46:15 +0200 [thread overview]
Message-ID: <20200504084615.27642-4-f4bug@amsat.org> (raw)
In-Reply-To: <20200504084615.27642-1-f4bug@amsat.org>
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
next prev parent reply other threads:[~2020-05-04 8:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-04 8:46 [PATCH 0/3] qom: Few trivial patches Philippe Mathieu-Daudé
2020-05-04 8:46 ` [PATCH 1/3] qom/object: Move Object typedef to 'qemu/typedefs.h' Philippe Mathieu-Daudé
2020-05-04 17:40 ` Richard Henderson
2020-05-04 8:46 ` [PATCH 2/3] io/task: Move 'qom/object.h' header to source Philippe Mathieu-Daudé
2020-05-04 17:42 ` Richard Henderson
2020-05-04 19:43 ` Philippe Mathieu-Daudé
2020-05-04 8:46 ` Philippe Mathieu-Daudé [this message]
2020-05-04 11:30 ` [PATCH 0/3] qom: Few trivial patches no-reply
2020-05-04 11:36 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200504084615.27642-4-f4bug@amsat.org \
--to=f4bug@amsat.org \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=ehabkost@redhat.com \
--cc=laurent@vivier.eu \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).