From: Amos Kong <akong@redhat.com>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org, aurelien@aurel32.net, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH] qemu: jaso-parser: Output the content of invalid keyword
Date: Wed, 24 Mar 2010 23:12:05 +0800 [thread overview]
Message-ID: <20100324151205.GA13786@akong@redhat.com> (raw)
In-Reply-To: <4BAA03E3.8010505@twiddle.net>
When input some invialid word 'unknowcmd' through QMP port, qemu outputs this
error message:
"parse error: invalid keyword `%s'"
This patch makes qemu output the content of invalid keyword, like:
"parse error: invalid keyword `unknowcmd'"
Signed-off-by: Amos Kong <akong@redhat.com>
---
json-parser.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/json-parser.c b/json-parser.c
index 579928f..b55d763 100644
--- a/json-parser.c
+++ b/json-parser.c
@@ -12,6 +12,7 @@
*/
#include <stdbool.h>
+#include <stdarg.h>
#include "qemu-common.h"
#include "qstring.h"
@@ -93,7 +94,12 @@ 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");
+ va_end(ap);
}
/**
--
1.6.3.3
next prev parent reply other threads:[~2010-03-24 15:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 12:17 [Qemu-devel] [PATCH][RESEND] qemu: jaso-parser: Output the content of invalid keyword Amos Kong
2010-03-24 12:21 ` Richard Henderson
2010-03-24 15:12 ` Amos Kong [this message]
2010-03-24 16:00 ` [Qemu-devel] [PATCH] " Markus Armbruster
2010-03-24 16:00 ` Markus Armbruster
2010-03-24 20:38 ` Luiz Capitulino
2010-03-24 20:38 ` Luiz Capitulino
2010-03-24 17:25 ` Richard Henderson
2010-03-24 17:25 ` [Qemu-devel] " Richard Henderson
2010-03-24 15:12 ` Amos Kong
-- strict thread matches above, loose matches on Subject: below --
2010-03-27 12:52 [Qemu-devel] " Aurelien Jarno
2010-03-27 12:52 ` Aurelien Jarno
2010-03-24 10:00 [PATCH] qemu-kvm: " Amos Kong
2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34 ` [Qemu-devel] [PATCH] qemu: " Amos Kong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100324151205.GA13786@akong@redhat.com \
--to=akong@redhat.com \
--cc=aurelien@aurel32.net \
--cc=kvm@vger.kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.