qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 14/31] python/qmp: switch qmp-shell to AQMP


From: John Snow
Subject: Re: [PATCH v3 14/31] python/qmp: switch qmp-shell to AQMP
Date: Wed, 12 Jan 2022 12:35:28 -0500

On Wed, Jan 12, 2022 at 8:52 AM Beraldo Leal <bleal@redhat.com> wrote:
>
> On Mon, Jan 10, 2022 at 06:28:53PM -0500, John Snow wrote:
> > We have a replacement for async QMP, but it doesn't have feature parity
> > yet. For now, then, port the old tool onto the new backend.
> >
> > Signed-off-by: John Snow <jsnow@redhat.com>
> > Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> > ---
> >  python/qemu/aqmp/legacy.py   |  3 +++
> >  python/qemu/qmp/qmp_shell.py | 31 +++++++++++++++++--------------
> >  2 files changed, 20 insertions(+), 14 deletions(-)
> >
> > diff --git a/python/qemu/aqmp/legacy.py b/python/qemu/aqmp/legacy.py
> > index 27df22818a..0890f95b16 100644
> > --- a/python/qemu/aqmp/legacy.py
> > +++ b/python/qemu/aqmp/legacy.py
> > @@ -22,6 +22,9 @@
> >  from .qmp_client import QMPClient
> >
> >
> > +# (Temporarily) Re-export QMPBadPortError
> > +QMPBadPortError = qemu.qmp.QMPBadPortError
>
> Probably I'm missing something, but any reason for not using, something
> like this?
>
> from qemu.qmp import (QMPMessage, QMPReturnValue, SocketAddrT,
>                       QMPBadPortError)
>

It's a declaration of intent; if I don't shuffle it into a new
assignment, mypy chirps a warning that I am using something "not
explicitly exported by the module". An alternative would be to define
an __all__ List[str], but that's even more churn for something that's
going to be deleted by the end of the series, so I went with this
little temporary hack instead.

Silly, yes.

--js




reply via email to

[Prev in Thread] Current Thread [Next in Thread]