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
This commit is contained in:
Markus Armbruster 2018-03-02 11:28:08 -05:00 committed by Lioncash
parent 23f5b17a08
commit d07bcef231
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 2 additions and 10 deletions

View file

@ -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"

View file

@ -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);
}
}
}