All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Eduardo Habkost <eduardo@habkost.net>,
	Peter Maydell <peter.maydell@linaro.org>,
	Beraldo Leal <bleal@redhat.com>,
	Qemu-block <qemu-block@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	Hanna Reitz <hreitz@redhat.com>, Cleber Rosa <crosa@redhat.com>
Subject: Re: [PATCH v4 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU
Date: Tue, 1 Feb 2022 13:33:48 -0500	[thread overview]
Message-ID: <CAFn=p-bJQV+2-Wcn8NnQ0H1FuUk7TUacqjcXA-cqZBZu3q9seg@mail.gmail.com> (raw)
In-Reply-To: <YfkurVhVj0L0Il1p@redhat.com>

On Tue, Feb 1, 2022 at 7:59 AM Kevin Wolf <kwolf@redhat.com> wrote:
>
> Am 01.02.2022 um 05:11 hat John Snow geschrieben:
> > QEMU versions prior to the "oob" capability *also* can't accept the
> > "enable" keyword argument at all. Fix the handshake process with older
> > QEMU versions.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > Reviewed-by: Hanna Reitz <hreitz@redhat.com>
> > ---
> >  python/qemu/aqmp/qmp_client.py | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/python/qemu/aqmp/qmp_client.py b/python/qemu/aqmp/qmp_client.py
> > index f1a845cc82..90a8737f03 100644
> > --- a/python/qemu/aqmp/qmp_client.py
> > +++ b/python/qemu/aqmp/qmp_client.py
> > @@ -292,9 +292,9 @@ async def _negotiate(self) -> None:
> >          """
> >          self.logger.debug("Negotiating capabilities ...")
> >
> > -        arguments: Dict[str, List[str]] = {'enable': []}
> > +        arguments: Dict[str, List[str]] = {}
> >          if self._greeting and 'oob' in self._greeting.QMP.capabilities:
> > -            arguments['enable'].append('oob')
> > +            arguments.setdefault('enable', []).append('oob')
> >          msg = self.make_execute_msg('qmp_capabilities', arguments=arguments)
>
> In case you have some interest in bike sheds:
>
> As long as we only ever append a single capability, it doesn't really
> make a difference and an explicit setdefault() when adding it is fine.
> But if we had more than one, maybe making arguments a defaultdict(list)
> would be nicer.
>
> Not worth respinning, of course, if you don't for another reason.
>
> Kevin
>

Nope, no reason. I just forget that there's a fancier doodad. I'll add
a patch to a less-important series to shine this up.

--js



  reply	other threads:[~2022-02-01 22:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01  4:11 [PATCH v4 0/4] Python: Improvements for iotest 040,041 John Snow
2022-02-01  4:11 ` [PATCH v4 1/4] python/aqmp: Fix negotiation with pre-"oob" QEMU John Snow
2022-02-01 12:59   ` Kevin Wolf
2022-02-01 18:33     ` John Snow [this message]
2022-02-01  4:11 ` [PATCH v4 2/4] python/machine: raise VMLaunchFailure exception from launch() John Snow
2022-02-01  4:11 ` [PATCH v4 3/4] python: upgrade mypy to 0.780 John Snow
2022-02-01  4:11 ` [PATCH v4 4/4] python/aqmp: add socket bind step to legacy.py John Snow
2022-02-01 13:21   ` Kevin Wolf
2022-02-01 18:32     ` John Snow
2022-02-01 19:46       ` Kevin Wolf
2022-02-02 19:08         ` John Snow
2022-02-03  9:19           ` Kevin Wolf
2022-02-04 21:23             ` John Snow
2022-02-03  9:38           ` Daniel P. Berrangé
2022-02-04  0:25             ` John Snow
2022-02-01 13:28 ` [PATCH v4 0/4] Python: Improvements for iotest 040,041 Kevin Wolf
2022-02-01 18:16   ` John Snow

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='CAFn=p-bJQV+2-Wcn8NnQ0H1FuUk7TUacqjcXA-cqZBZu3q9seg@mail.gmail.com' \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=bleal@redhat.com \
    --cc=crosa@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-block@nongnu.org \
    --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.