All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] qapi/qmp-dispatch: Fix error class for reporting disabled commands
Date: Tue, 24 Sep 2019 14:33:50 +0200	[thread overview]
Message-ID: <87d0fp7u1d.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <87impw598s.fsf@dusky.pond.sub.org> (Markus Armbruster's message of "Fri, 13 Sep 2019 20:41:55 +0200")

Markus Armbruster <armbru@redhat.com> writes:

> Michal Privoznik <mprivozn@redhat.com> writes:
>
>> On 9/13/19 2:52 PM, Markus Armbruster wrote:
>>> Michal Privoznik <mprivozn@redhat.com> writes:
>>>
>>>> If a command is disabled an error is reported. But due to usage
>>>> of error_setg() the class of the error is GenericError which does
>>>> not help callers in distinguishing this case from a case where a
>>>> qmp command fails regularly due to other reasons. Use
>>>> CommandNotFound error class which is much closer to the actual
>>>> root cause.
>>>>
>>>> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
>>>> ---
>>>
>>> I'd like to tweak the commit message a bit:
>>>
>>>    qmp-dispatch: Use CommandNotFound error for disabled commands
>>>
>>>    If a command is disabled an error is reported.  But due to usage of
>>>    error_setg() the class of the error is GenericError which does not
>>>    help callers in distinguishing this case from a case where a qmp
>>>    command fails regularly due to other reasons.
>>>
>>>    We used to use class CommandDisabled until the great error
>>>    simplification (commit de253f1491 for QMP and commit 93b91c59db for
>>>    qemu-ga, both v1.2.0).
>>>
>>>    Use CommandNotFound error class, which is close enough.
>>>
>>> Objections?
>>>
>>
>> None, thanks for taking care of this.
>
> Need to squash in:
>
> diff --git a/tests/test-qga.c b/tests/test-qga.c
> index 891aa3d322..1ca49bbced 100644
> --- a/tests/test-qga.c
> +++ b/tests/test-qga.c
> @@ -668,7 +668,7 @@ static void test_qga_blacklist(gconstpointer data)
>      error = qdict_get_qdict(ret, "error");
>      class = qdict_get_try_str(error, "class");
>      desc = qdict_get_try_str(error, "desc");
> -    g_assert_cmpstr(class, ==, "GenericError");
> +    g_assert_cmpstr(class, ==, "CommandNotFound");
>      g_assert_nonnull(g_strstr_len(desc, -1, "has been disabled"));
>      qobject_unref(ret);
>  
> @@ -677,7 +677,7 @@ static void test_qga_blacklist(gconstpointer data)
>      error = qdict_get_qdict(ret, "error");
>      class = qdict_get_try_str(error, "class");
>      desc = qdict_get_try_str(error, "desc");
> -    g_assert_cmpstr(class, ==, "GenericError");
> +    g_assert_cmpstr(class, ==, "CommandNotFound");
>      g_assert_nonnull(g_strstr_len(desc, -1, "has been disabled"));
>      qobject_unref(ret);
>  

I tried to include the amended patch in today's pull request, but
observed "make check" hangs with it.


  reply	other threads:[~2019-09-24 13:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-30 13:29 [Qemu-devel] [PATCH v2] qapi/qmp-dispatch: Fix error class for reporting disabled commands Michal Privoznik
2019-08-30 13:49 ` Eric Blake
2019-09-13 12:52 ` Markus Armbruster
2019-09-13 13:52   ` Michal Privoznik
2019-09-13 18:41     ` Markus Armbruster
2019-09-24 12:33       ` Markus Armbruster [this message]
2019-09-24 14:45         ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0fp7u1d.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mprivozn@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.