From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45913) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu1x3-0002V2-CO for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:57:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wu1wx-0002eG-Bw for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:57:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20539) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wu1wx-0002dn-4W for qemu-devel@nongnu.org; Mon, 09 Jun 2014 11:57:31 -0400 Date: Mon, 9 Jun 2014 17:57:20 +0200 From: Igor Mammedov Message-ID: <20140609175720.264d34d5@thinkpad> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v4 08/29] qmp: improve error reporting for -object and object-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao Cc: Yasunori Goto , Paolo Bonzini , "Michael S. Tsirkin" , qemu-devel@nongnu.org, Eduardo Habkost On Mon, 9 Jun 2014 18:25:13 +0800 Hu Tao wrote: > From: Paolo Bonzini > > Use QERR_INVALID_PARAMETER_VALUE for consistency. > > Signed-off-by: Paolo Bonzini > Signed-off-by: Hu Tao > Reviewed-by: Eduardo Habkost > --- > 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