* [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
* Re: [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword
2010-03-24 10:00 [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword Amos Kong
@ 2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34 ` [PATCH] qemu: " Amos Kong
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Aurelien Jarno @ 2010-03-24 10:29 UTC (permalink / raw)
To: Amos Kong; +Cc: kvm
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.
> 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
>
>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] qemu: jaso-parser: Output the content of invalid keyword
2010-03-24 10:29 ` Aurelien Jarno
@ 2010-03-24 11:34 ` Amos Kong
2010-03-24 11:34 ` [Qemu-devel] " Amos Kong
2010-03-24 14:03 ` [PATCH] qemu-kvm: " Luiz Capitulino
2 siblings, 0 replies; 5+ messages in thread
From: Amos Kong @ 2010-03-24 11:34 UTC (permalink / raw)
To: qemu-devel; +Cc: aurelien, kvm
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, like:
"parse error: invalid keyword `unknow_cmd'"
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.5.5.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH] qemu: jaso-parser: Output the content of invalid keyword
2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34 ` [PATCH] qemu: " Amos Kong
@ 2010-03-24 11:34 ` Amos Kong
2010-03-24 14:03 ` [PATCH] qemu-kvm: " Luiz Capitulino
2 siblings, 0 replies; 5+ messages in thread
From: Amos Kong @ 2010-03-24 11:34 UTC (permalink / raw)
To: qemu-devel; +Cc: aurelien, kvm
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, like:
"parse error: invalid keyword `unknow_cmd'"
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.5.5.6
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword
2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34 ` [PATCH] qemu: " Amos Kong
2010-03-24 11:34 ` [Qemu-devel] " Amos Kong
@ 2010-03-24 14:03 ` Luiz Capitulino
2 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2010-03-24 14:03 UTC (permalink / raw)
To: Aurelien Jarno; +Cc: Amos Kong, kvm
On Wed, 24 Mar 2010 11:29:40 +0100
Aurelien Jarno <aurelien@aurel32.net> 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 <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 [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-24 14:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-24 10:00 [PATCH] qemu-kvm: jaso-parser: Output the content of invalid keyword Amos Kong
2010-03-24 10:29 ` Aurelien Jarno
2010-03-24 11:34 ` [PATCH] qemu: " Amos Kong
2010-03-24 11:34 ` [Qemu-devel] " Amos Kong
2010-03-24 14:03 ` [PATCH] qemu-kvm: " Luiz Capitulino
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.