[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 10/28] qmp: Improve QMP dispatch error messag
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 10/28] qmp: Improve QMP dispatch error messages |
Date: |
Tue, 7 Mar 2017 08:21:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 |
On 03/05/2017 02:01 AM, Markus Armbruster wrote:
> Since substantial other work depends on this series, it needs to go in
> sooner rather than later. I'm therefore *dropping* this patch from the
> series. We can then bikeshed^Wpolish to our heart's content without
> holding up other work.
>
> That said: what about this?
>
> diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
> index dc50212..5ad36f8 100644
> --- a/qapi/qmp-dispatch.c
> +++ b/qapi/qmp-dispatch.c
> @@ -30,7 +30,7 @@ static QDict *qmp_dispatch_check_obj(const QObject
> *request, Error **errp)
>
> dict = qobject_to_qdict(request);
> if (!dict) {
> - error_setg(errp, "Expected '%s' in QMP input", "object");
> + error_setg(errp, "QMP input must be a JSON object");
> return NULL;
> }
>
> @@ -41,26 +41,26 @@ static QDict *qmp_dispatch_check_obj(const QObject
> *request, Error **errp)
>
> if (!strcmp(arg_name, "execute")) {
> if (qobject_type(arg_obj) != QTYPE_QSTRING) {
> - error_setg(errp, "QMP input object member '%s' expects '%s'",
> - "execute", "string");
> + error_setg(errp,
> + "QMP input member 'execute' must be a string");
> return NULL;
> }
> has_exec_key = true;
> } else if (!strcmp(arg_name, "arguments")) {
> if (qobject_type(arg_obj) != QTYPE_QDICT) {
> - error_setg(errp, "QMP input object member '%s' expects '%s'",
> - "arguments", "object");
> + error_setg(errp,
> + "QMP input member 'arguments' must be an object");
> return NULL;
> }
> } else {
> - error_setg(errp, "QMP input object member '%s' is unexpected",
> + error_setg(errp, "QMP input member '%s' is unexpected",
> arg_name);
> return NULL;
> }
> }
>
> if (!has_exec_key) {
> - error_setg(errp, "Expected '%s' in QMP input", "execute");
> + error_setg(errp, "QMP input lacks member 'execute'");
> return NULL;
> }
>
>
>
Based on the rest of this sub-thread, I'm making it explicit that you
can add:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v4 13/28] qapi: Make QObject input visitor set *list reliably, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 03/28] qmp-test: New, covering basic QMP protocol, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 08/28] qmp: Drop duplicated QMP command object checks, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 09/28] qmp: Eliminate silly QERR_QMP_* macros, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 18/28] test-qobject-input-visitor: Use strict visitor, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 01/28] qga: Fix crash on non-dictionary QMP argument, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 11/28] qapi: Improve a QObject input visitor error message, Markus Armbruster, 2017/03/03
[Qemu-devel] [PATCH v4 06/28] qapi-introspect: Mangle --prefix argument properly for C, Markus Armbruster, 2017/03/03