From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luiz Capitulino Subject: Re: [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword Date: Wed, 24 Mar 2010 11:03:30 -0300 Message-ID: <20100324110330.621fac1a@redhat.com> References: <1269424853-15386-1-git-send-email-akong@redhat.com> <20100324102940.GA22874@hall.aurel32.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Amos Kong , kvm@vger.kernel.org To: Aurelien Jarno Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57787 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755946Ab0CXODr (ORCPT ); Wed, 24 Mar 2010 10:03:47 -0400 In-Reply-To: <20100324102940.GA22874@hall.aurel32.net> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 24 Mar 2010 11:29:40 +0100 Aurelien Jarno wrote: > Hi, > > On Wed, Mar 24, 2010 at 06:00:53PM +0800, Amos Kong wrote: > > When input some invialid words in QMP port, qemu outputs this error message: > > "parse error: invalid keyword `%s'" > > This patch makes qemu output the content. > > Is this patch for QEMU or KVM? If it is for QEMU, you should put the > QEMU mailing list in Cc:. If it is for KVM, I don't have commit access > there. It's for QEMU and looks good to me. Amos, can you resend there please? Just to take the right route.. > > > Signed-off-by: Amos Kong > > --- > > json-parser.c | 7 ++++++- > > 1 files changed, 6 insertions(+), 1 deletions(-) > > > > diff --git a/json-parser.c b/json-parser.c > > index 579928f..98a82af 100644 > > --- a/json-parser.c > > +++ b/json-parser.c > > @@ -12,6 +12,7 @@ > > */ > > > > #include > > +#include > > > > #include "qemu-common.h" > > #include "qstring.h" > > @@ -93,7 +94,11 @@ static int token_is_escape(QObject *obj, const char *value) > > */ > > static void parse_error(JSONParserContext *ctxt, QObject *token, const char *msg, ...) > > { > > - fprintf(stderr, "parse error: %s\n", msg); > > + va_list ap; > > + va_start(ap, msg); > > + fprintf(stderr, "parse error:"); > > + vfprintf(stderr, msg, ap); > > + fprintf(stderr, "\n"); > > } > > > > /** > > -- > > 1.6.3.3 > > > > >