On Mon, 9 Jun 2014 18:25:13 +0800 Hu Tao <hu...@cn.fujitsu.com> wrote:
> From: Paolo Bonzini <pbonz...@redhat.com> > > Use QERR_INVALID_PARAMETER_VALUE for consistency. > > Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> > Signed-off-by: Hu Tao <hu...@cn.fujitsu.com> > Reviewed-by: Eduardo Habkost <ehabk...@redhat.com> > --- > qmp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/qmp.c b/qmp.c > index b722dbe..cef60fb 100644 > --- a/qmp.c > +++ b/qmp.c > @@ -540,7 +540,8 @@ void object_add(const char *type, const char *id, const > QDict *qdict, > > klass = object_class_by_name(type); > if (!klass) { > - error_setg(errp, "invalid class name"); > + error_set(errp, QERR_INVALID_PARAMETER_VALUE, > + "qom-type", "a valid class name"); With implicit "qom-type" on CLI it might be not clear to user what value is wrong. Perhaps following would be better: error_setg(errp, "Invalid object type name: %s", type); > return; > } > > -- > 1.9.3 > -- Regards, Igor