qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] keyval: Print types on merge inconsistency
@ 2022-09-13 10:08 Dr. David Alan Gilbert (git)
  2022-09-16  5:47 ` Markus Armbruster
  0 siblings, 1 reply; 2+ messages in thread
From: Dr. David Alan Gilbert (git) @ 2022-09-13 10:08 UTC (permalink / raw)
  To: qemu-devel, armbru

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

When 'keyval_do_merge' checks consistency of types, if they mismatch
print the types so we get a hint of what's going on.

e.g.
qemu-system-x86_64: Parameter 'memory' used inconsistently (qstring/qdict)

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 util/keyval.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/util/keyval.c b/util/keyval.c
index 66a5b4740f..9757adf31f 100644
--- a/util/keyval.c
+++ b/util/keyval.c
@@ -329,8 +329,10 @@ static void keyval_do_merge(QDict *dest, const QDict *merged, GString *str, Erro
         old_value = qdict_get(dest, ent->key);
         if (old_value) {
             if (qobject_type(old_value) != qobject_type(ent->value)) {
-                error_setg(errp, "Parameter '%s%s' used inconsistently",
-                           str->str, ent->key);
+                error_setg(errp, "Parameter '%s%s' used inconsistently (%s/%s)",
+                           str->str, ent->key,
+                           QType_str(qobject_type(old_value)),
+                           QType_str(qobject_type(ent->value)));
                 return;
             } else if (qobject_type(ent->value) == QTYPE_QDICT) {
                 /* Merge sub-dictionaries.  */
-- 
2.37.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-16  5:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13 10:08 [PATCH] keyval: Print types on merge inconsistency Dr. David Alan Gilbert (git)
2022-09-16  5:47 ` Markus Armbruster

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).