"Dr. David Alan Gilbert (git)" <dgilb...@redhat.com> writes:
> From: "Dr. David Alan Gilbert" <dgilb...@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 <dgilb...@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))); Two more, one in keyval_parse_put(), and one in keyval_listify(). The error message talks in developer terms. Can we talk in user terms instead? Could showing the conflicting key suffice? > return; > } else if (qobject_type(ent->value) == QTYPE_QDICT) { > /* Merge sub-dictionaries. */