qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Peter Xu" <peterx@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] monitor: fix expected qmp_capabilities error description regression
Date: Fri, 23 Mar 2018 16:56:34 -0500	[thread overview]
Message-ID: <15aaea55-9ebd-8a16-c25e-c9bc709fcabc@redhat.com> (raw)
In-Reply-To: <CAMxuvax=SPeOui3mGcmK8HAo7EqDbpUSZ8Fq3mVHCrLztmBCLA@mail.gmail.com>

On 03/23/2018 10:50 AM, Marc-André Lureau wrote:

>> If we are going to remove below chunk, how about do it in prettier
>> way instead of hacking around the error again?  Like:
>>
>> diff --git a/monitor.c b/monitor.c
>> index 77f4c41cfa..849fa23bf9 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -1203,8 +1203,14 @@ static bool qmp_cmd_oob_check(Monitor *mon, QDict *req, Error **errp)
>>
>>       cmd = qmp_find_command(mon->qmp.commands, command);
>>       if (!cmd) {
>> -        error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
>> -                  "The command %s has not been found", command);
>> +        if (mon->qmp.commands == &qmp_cap_negotiation_commands) {
>> +            error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
>> +                      "Expecting capabilities negotiation "
>> +                      "with 'qmp_capabilities'");
>> +        } else {
>> +            error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
>> +                      "The command %s has not been found", command);
>> +        }
>>           return false;
>>       }
>>
>> What do you think?

Yes, that looks nicer.

>>
> 
> Works for me (fwiw, I'll probably need the replace "hack" again,
> because in the RFC series I am about to send, the code is factored out
> / generalized in qmp-dispatch), but that works in the meantime, please
> send a patch.

There have been quite a few patch ideas across multiple threads related 
to OOB fallout.  Hopefully I can keep straight which patches are 
intended for 2.12 (anything that fixes a bug, like this one, is a good 
candidate, and it would be nice if we can undo the temporary reversion 
of exposing OOB if we can solve all the issues that iotests exposed).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  reply	other threads:[~2018-03-23 21:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 10:32 [Qemu-devel] [PATCH] monitor: fix expected qmp_capabilities error description regression Marc-André Lureau
2018-03-23 15:35 ` Peter Xu
2018-03-23 15:50   ` Marc-André Lureau
2018-03-23 21:56     ` Eric Blake [this message]
2018-03-24  1:41       ` Peter Xu
2018-03-24 11:41         ` Eric Blake
2018-03-26  3:19           ` Peter Xu

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=15aaea55-9ebd-8a16-c25e-c9bc709fcabc@redhat.com \
    --to=eblake@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peterx@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).