When input some invalid 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>
Acked-by: Richard Henderson <rth@redhat.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
*/
#include <stdbool.h>
+#include <stdarg.h>
#include "qemu-common.h"
#include "qstring.h"
*/
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);
}
/**