From d07bcef2315df6de790d966183a09183a8494163 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 2 Mar 2018 11:28:08 -0500 Subject: [PATCH] qmp: Eliminate silly QERR_QMP_* macros The QERR_ macros are leftovers from the days of "rich" error objects. QERR_QMP_BAD_INPUT_OBJECT, QERR_QMP_BAD_INPUT_OBJECT_MEMBER, QERR_QMP_EXTRA_MEMBER are used in just one place now, except for one use that has crept into qobject-input-visitor.c. Drop these macros, to make the (bad) error messages more visible. Backports commit 99fb0c53c038105bae68b02a3d9f1cbf7951ba10 from qemu --- qemu/include/qapi/qmp/qerror.h | 9 --------- qemu/qapi/qobject-input-visitor.c | 3 ++- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/qemu/include/qapi/qmp/qerror.h b/qemu/include/qapi/qmp/qerror.h index 53782efe..377b7ec3 100644 --- a/qemu/include/qapi/qmp/qerror.h +++ b/qemu/include/qapi/qmp/qerror.h @@ -112,15 +112,6 @@ #define QERR_QGA_COMMAND_FAILED \ "Guest agent command failed, error was '%s'" -#define QERR_QMP_BAD_INPUT_OBJECT \ - "Expected '%s' in QMP input" - -#define QERR_QMP_BAD_INPUT_OBJECT_MEMBER \ - "QMP input object member '%s' expects '%s'" - -#define QERR_QMP_EXTRA_MEMBER \ - "QMP input object member '%s' is unexpected" - #define QERR_SET_PASSWD_FAILED \ "Could not set password" diff --git a/qemu/qapi/qobject-input-visitor.c b/qemu/qapi/qobject-input-visitor.c index 8e455d50..bcc1582f 100644 --- a/qemu/qapi/qobject-input-visitor.c +++ b/qemu/qapi/qobject-input-visitor.c @@ -144,7 +144,8 @@ static void qobject_input_check_struct(Visitor *v, Error **errp) if (g_hash_table_size(top_ht)) { const char *key; g_hash_table_find(top_ht, always_true, (gpointer)&key); - error_setg(errp, QERR_QMP_EXTRA_MEMBER, key); + error_setg(errp, "QMP input object member '%s' is unexpected", + key); } } }