public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword
@ 2010-03-24 10:00 Amos Kong
  2010-03-24 10:29 ` Aurelien Jarno
  0 siblings, 1 reply; 5+ messages in thread
From: Amos Kong @ 2010-03-24 10:00 UTC (permalink / raw)
  To: aurelien; +Cc: kvm, Amos Kong

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.

Signed-off-by: Amos Kong <akong@redhat.com>
---
 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 <stdbool.h>
+#include <stdarg.h>
 
 #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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-24 20:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1269433020-16055-1-git-send-email-akong@redhat.com>
     [not found] ` <4BAA03E3.8010505@twiddle.net>
2010-03-24 15:12   ` [PATCH] qemu: jaso-parser: Output the content of invalid keyword Amos Kong
     [not found]   ` <20100324151205.GA13786@akong@redhat.com>
2010-03-24 16:00     ` [Qemu-devel] " Markus Armbruster
2010-03-24 20:38       ` Luiz Capitulino
2010-03-24 17:25     ` Richard Henderson
2010-03-24 10:00 [PATCH] qemu-kvm: " Amos Kong
2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34   ` [PATCH] qemu: " Amos Kong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox