Re: [PATCH v2 25/25] python: rename qemu.aqmp to qemu.qmp

2021-12-17 Thread John Snow
On Fri, Dec 17, 2021, 2:40 AM Vladimir Sementsov-Ogievskiy <
vsement...@virtuozzo.com> wrote:

> 17.12.2021 00:10, John Snow wrote:
> >
> >
> > On Thu, Dec 16, 2021 at 6:41 AM Vladimir Sementsov-Ogievskiy <
> vsement...@virtuozzo.com > wrote:
> >
> > 15.12.2021 22:39, John Snow wrote:
> >  > Now that we are fully switched over to the new QMP library, move
> it back
> >  > over the old namespace. This is being done primarily so that we
> may
> >  > upload this package simply as "qemu.qmp" without introducing
> confusion
> >  > over whether or not "aqmp" is a new protocol or not.
> >  >
> >  > The trade-off is increased confusion inside the QEMU developer
> >  > tree. Sorry!
> >  >
> >  > Signed-off-by: John Snow js...@redhat.com>>
> >
> > Great job!
> >
> > I looked thorough the patch, changes looks correct. Simply rename
> every aqmp / AQMP occurrence.. But:
> >
> >
> > [root@kvm review]# git grep -i aqmp
> > python/qemu/qmp/aqmp_tui.py:AQMP TUI
> > python/qemu/qmp/aqmp_tui.py:AQMP TUI is an asynchronous interface
> built on top the of the AQMP library.
> > python/qemu/qmp/aqmp_tui.py:Example Usage: aqmp-tui  IP:PORT>
> > python/qemu/qmp/aqmp_tui.py:Full Usage: aqmp-tui --help
> > python/qemu/qmp/aqmp_tui.py:Implements the AQMP TUI.
> > python/qemu/qmp/aqmp_tui.py:parser =
> argparse.ArgumentParser(description='AQMP TUI')
> > python/qemu/qmp/legacy.py:self._aqmp = QMPClient(nickname)
> > python/qemu/qmp/legacy.py:if self._aqmp.greeting is not None:
> > python/qemu/qmp/legacy.py:return
> self._aqmp.greeting._asdict()
> > python/qemu/qmp/legacy.py:self._aqmp.await_greeting =
> negotiate
> > python/qemu/qmp/legacy.py:self._aqmp.negotiate = negotiate
> > python/qemu/qmp/legacy.py:
> self._aqmp.connect(self._address)
> > python/qemu/qmp/legacy.py:self._aqmp.await_greeting = True
> > python/qemu/qmp/legacy.py:self._aqmp.negotiate = True
> > python/qemu/qmp/legacy.py:
> self._aqmp.accept(self._address),
> > python/qemu/qmp/legacy.py:self._aqmp._raw(qmp_cmd,
> assign_id=False),
> > python/qemu/qmp/legacy.py:self._aqmp.execute(cmd, kwds),
> > python/qemu/qmp/legacy.py:if self._aqmp.events.empty():
> > python/qemu/qmp/legacy.py:self._aqmp.events.get(),
> > python/qemu/qmp/legacy.py:events = [dict(x) for x in
> self._aqmp.events.clear()]
> > python/qemu/qmp/legacy.py:self._aqmp.events.clear()
> > python/qemu/qmp/legacy.py:self._aqmp.disconnect()
> > python/qemu/qmp/legacy.py:self._aqmp.send_fd_scm(fd)
> > python/qemu/qmp/legacy.py:if self._aqmp.runstate ==
> Runstate.IDLE:
> > python/setup.cfg:# AQMP TUI dependencies
> > python/setup.cfg:aqmp-tui = qemu.qmp.aqmp_tui:main [tui]
> > python/setup.cfg:[mypy-qemu.qmp.aqmp_tui]
> >
> > [root@kvm review]# git ls-tree -r --name-only HEAD | grep -i aqmp
> > python/qemu/qmp/aqmp_tui.py
> >
> >
> > I think, this all should be renamed too
> >
> >
> > For aqmp_tui.py, sure. The new TUI isn't 100% ready to replace qmp-shell
> yet, so I wasn't entirely certain what to name it... qmp-tui?
> >
> > *shrugs*.
>
> I don't remember what tui is abbreviating) qmp-tui is OK, and it may be
> renamed to qmp-shell when it is ready to replace it..
>

"text user interface", by analogy with GUI (graphical UI).


> >
> > for legacy.py, it's just an internal variable name and I wasn't sure it
> was worth the churn just to change a private variable. I could still do it
> if you feel strongly about it.
> >
>
> I'd rename everything.
>

Alright, I'll do so in the respin.


>
> --
> Best regards,
> Vladimir
>

Thanks for the reviews!

>


Re: [PATCH v2 25/25] python: rename qemu.aqmp to qemu.qmp

2021-12-16 Thread Vladimir Sementsov-Ogievskiy

17.12.2021 00:10, John Snow wrote:



On Thu, Dec 16, 2021 at 6:41 AM Vladimir Sementsov-Ogievskiy mailto:vsement...@virtuozzo.com>> wrote:

15.12.2021 22:39, John Snow wrote:
 > Now that we are fully switched over to the new QMP library, move it back
 > over the old namespace. This is being done primarily so that we may
 > upload this package simply as "qemu.qmp" without introducing confusion
 > over whether or not "aqmp" is a new protocol or not.
 >
 > The trade-off is increased confusion inside the QEMU developer
 > tree. Sorry!
 >
 > Signed-off-by: John Snowmailto:js...@redhat.com>>

Great job!

I looked thorough the patch, changes looks correct. Simply rename every 
aqmp / AQMP occurrence.. But:


[root@kvm review]# git grep -i aqmp
python/qemu/qmp/aqmp_tui.py:AQMP TUI
python/qemu/qmp/aqmp_tui.py:AQMP TUI is an asynchronous interface built on 
top the of the AQMP library.
python/qemu/qmp/aqmp_tui.py:Example Usage: aqmp-tui 
python/qemu/qmp/aqmp_tui.py:Full Usage: aqmp-tui --help
python/qemu/qmp/aqmp_tui.py:    Implements the AQMP TUI.
python/qemu/qmp/aqmp_tui.py:    parser = 
argparse.ArgumentParser(description='AQMP TUI')
python/qemu/qmp/legacy.py:        self._aqmp = QMPClient(nickname)
python/qemu/qmp/legacy.py:        if self._aqmp.greeting is not None:
python/qemu/qmp/legacy.py:            return self._aqmp.greeting._asdict()
python/qemu/qmp/legacy.py:        self._aqmp.await_greeting = negotiate
python/qemu/qmp/legacy.py:        self._aqmp.negotiate = negotiate
python/qemu/qmp/legacy.py:            self._aqmp.connect(self._address)
python/qemu/qmp/legacy.py:        self._aqmp.await_greeting = True
python/qemu/qmp/legacy.py:        self._aqmp.negotiate = True
python/qemu/qmp/legacy.py:            self._aqmp.accept(self._address),
python/qemu/qmp/legacy.py:                self._aqmp._raw(qmp_cmd, 
assign_id=False),
python/qemu/qmp/legacy.py:            self._aqmp.execute(cmd, kwds),
python/qemu/qmp/legacy.py:            if self._aqmp.events.empty():
python/qemu/qmp/legacy.py:                self._aqmp.events.get(),
python/qemu/qmp/legacy.py:        events = [dict(x) for x in 
self._aqmp.events.clear()]
python/qemu/qmp/legacy.py:        self._aqmp.events.clear()
python/qemu/qmp/legacy.py:            self._aqmp.disconnect()
python/qemu/qmp/legacy.py:        self._aqmp.send_fd_scm(fd)
python/qemu/qmp/legacy.py:        if self._aqmp.runstate == Runstate.IDLE:
python/setup.cfg:# AQMP TUI dependencies
python/setup.cfg:    aqmp-tui = qemu.qmp.aqmp_tui:main [tui]
python/setup.cfg:[mypy-qemu.qmp.aqmp_tui]

[root@kvm review]# git ls-tree -r --name-only HEAD | grep -i aqmp
python/qemu/qmp/aqmp_tui.py


I think, this all should be renamed too


For aqmp_tui.py, sure. The new TUI isn't 100% ready to replace qmp-shell yet, 
so I wasn't entirely certain what to name it... qmp-tui?

*shrugs*.


I don't remember what tui is abbreviating) qmp-tui is OK, and it may be renamed 
to qmp-shell when it is ready to replace it..



for legacy.py, it's just an internal variable name and I wasn't sure it was 
worth the churn just to change a private variable. I could still do it if you 
feel strongly about it.



I'd rename everything.


--
Best regards,
Vladimir



Re: [PATCH v2 25/25] python: rename qemu.aqmp to qemu.qmp

2021-12-16 Thread John Snow
On Thu, Dec 16, 2021 at 6:41 AM Vladimir Sementsov-Ogievskiy <
vsement...@virtuozzo.com> wrote:

> 15.12.2021 22:39, John Snow wrote:
> > Now that we are fully switched over to the new QMP library, move it back
> > over the old namespace. This is being done primarily so that we may
> > upload this package simply as "qemu.qmp" without introducing confusion
> > over whether or not "aqmp" is a new protocol or not.
> >
> > The trade-off is increased confusion inside the QEMU developer
> > tree. Sorry!
> >
> > Signed-off-by: John Snow
>
> Great job!
>
> I looked thorough the patch, changes looks correct. Simply rename every
> aqmp / AQMP occurrence.. But:
>
>
> [root@kvm review]# git grep -i aqmp
> python/qemu/qmp/aqmp_tui.py:AQMP TUI
> python/qemu/qmp/aqmp_tui.py:AQMP TUI is an asynchronous interface built on
> top the of the AQMP library.
> python/qemu/qmp/aqmp_tui.py:Example Usage: aqmp-tui 
> python/qemu/qmp/aqmp_tui.py:Full Usage: aqmp-tui --help
> python/qemu/qmp/aqmp_tui.py:Implements the AQMP TUI.
> python/qemu/qmp/aqmp_tui.py:parser =
> argparse.ArgumentParser(description='AQMP TUI')
> python/qemu/qmp/legacy.py:self._aqmp = QMPClient(nickname)
> python/qemu/qmp/legacy.py:if self._aqmp.greeting is not None:
> python/qemu/qmp/legacy.py:return self._aqmp.greeting._asdict()
> python/qemu/qmp/legacy.py:self._aqmp.await_greeting = negotiate
> python/qemu/qmp/legacy.py:self._aqmp.negotiate = negotiate
> python/qemu/qmp/legacy.py:self._aqmp.connect(self._address)
> python/qemu/qmp/legacy.py:self._aqmp.await_greeting = True
> python/qemu/qmp/legacy.py:self._aqmp.negotiate = True
> python/qemu/qmp/legacy.py:self._aqmp.accept(self._address),
> python/qemu/qmp/legacy.py:self._aqmp._raw(qmp_cmd,
> assign_id=False),
> python/qemu/qmp/legacy.py:self._aqmp.execute(cmd, kwds),
> python/qemu/qmp/legacy.py:if self._aqmp.events.empty():
> python/qemu/qmp/legacy.py:self._aqmp.events.get(),
> python/qemu/qmp/legacy.py:events = [dict(x) for x in
> self._aqmp.events.clear()]
> python/qemu/qmp/legacy.py:self._aqmp.events.clear()
> python/qemu/qmp/legacy.py:self._aqmp.disconnect()
> python/qemu/qmp/legacy.py:self._aqmp.send_fd_scm(fd)
> python/qemu/qmp/legacy.py:if self._aqmp.runstate == Runstate.IDLE:
> python/setup.cfg:# AQMP TUI dependencies
> python/setup.cfg:aqmp-tui = qemu.qmp.aqmp_tui:main [tui]
> python/setup.cfg:[mypy-qemu.qmp.aqmp_tui]
>
> [root@kvm review]# git ls-tree -r --name-only HEAD | grep -i aqmp
> python/qemu/qmp/aqmp_tui.py
>
>
> I think, this all should be renamed too


For aqmp_tui.py, sure. The new TUI isn't 100% ready to replace qmp-shell
yet, so I wasn't entirely certain what to name it... qmp-tui?

*shrugs*.

for legacy.py, it's just an internal variable name and I wasn't sure it was
worth the churn just to change a private variable. I could still do it if
you feel strongly about it.

--js


Re: [PATCH v2 25/25] python: rename qemu.aqmp to qemu.qmp

2021-12-16 Thread Vladimir Sementsov-Ogievskiy

15.12.2021 22:39, John Snow wrote:

Now that we are fully switched over to the new QMP library, move it back
over the old namespace. This is being done primarily so that we may
upload this package simply as "qemu.qmp" without introducing confusion
over whether or not "aqmp" is a new protocol or not.

The trade-off is increased confusion inside the QEMU developer
tree. Sorry!

Signed-off-by: John Snow


Great job!

I looked thorough the patch, changes looks correct. Simply rename every aqmp / 
AQMP occurrence.. But:


[root@kvm review]# git grep -i aqmp
python/qemu/qmp/aqmp_tui.py:AQMP TUI
python/qemu/qmp/aqmp_tui.py:AQMP TUI is an asynchronous interface built on top 
the of the AQMP library.
python/qemu/qmp/aqmp_tui.py:Example Usage: aqmp-tui 
python/qemu/qmp/aqmp_tui.py:Full Usage: aqmp-tui --help
python/qemu/qmp/aqmp_tui.py:Implements the AQMP TUI.
python/qemu/qmp/aqmp_tui.py:parser = 
argparse.ArgumentParser(description='AQMP TUI')
python/qemu/qmp/legacy.py:self._aqmp = QMPClient(nickname)
python/qemu/qmp/legacy.py:if self._aqmp.greeting is not None:
python/qemu/qmp/legacy.py:return self._aqmp.greeting._asdict()
python/qemu/qmp/legacy.py:self._aqmp.await_greeting = negotiate
python/qemu/qmp/legacy.py:self._aqmp.negotiate = negotiate
python/qemu/qmp/legacy.py:self._aqmp.connect(self._address)
python/qemu/qmp/legacy.py:self._aqmp.await_greeting = True
python/qemu/qmp/legacy.py:self._aqmp.negotiate = True
python/qemu/qmp/legacy.py:self._aqmp.accept(self._address),
python/qemu/qmp/legacy.py:self._aqmp._raw(qmp_cmd, 
assign_id=False),
python/qemu/qmp/legacy.py:self._aqmp.execute(cmd, kwds),
python/qemu/qmp/legacy.py:if self._aqmp.events.empty():
python/qemu/qmp/legacy.py:self._aqmp.events.get(),
python/qemu/qmp/legacy.py:events = [dict(x) for x in 
self._aqmp.events.clear()]
python/qemu/qmp/legacy.py:self._aqmp.events.clear()
python/qemu/qmp/legacy.py:self._aqmp.disconnect()
python/qemu/qmp/legacy.py:self._aqmp.send_fd_scm(fd)
python/qemu/qmp/legacy.py:if self._aqmp.runstate == Runstate.IDLE:
python/setup.cfg:# AQMP TUI dependencies
python/setup.cfg:aqmp-tui = qemu.qmp.aqmp_tui:main [tui]
python/setup.cfg:[mypy-qemu.qmp.aqmp_tui]

[root@kvm review]# git ls-tree -r --name-only HEAD | grep -i aqmp
python/qemu/qmp/aqmp_tui.py


I think, this all should be renamed too

--
Best regards,
Vladimir



[PATCH v2 25/25] python: rename qemu.aqmp to qemu.qmp

2021-12-15 Thread John Snow
Now that we are fully switched over to the new QMP library, move it back
over the old namespace. This is being done primarily so that we may
upload this package simply as "qemu.qmp" without introducing confusion
over whether or not "aqmp" is a new protocol or not.

The trade-off is increased confusion inside the QEMU developer
tree. Sorry!

Signed-off-by: John Snow 
---
 python/PACKAGE.rst|  4 ++--
 python/README.rst |  4 ++--
 python/qemu/machine/machine.py|  4 ++--
 python/qemu/machine/qtest.py  |  2 +-
 python/qemu/{aqmp => qmp}/__init__.py |  6 +++---
 python/qemu/{aqmp => qmp}/aqmp_tui.py |  0
 python/qemu/{aqmp => qmp}/error.py|  0
 python/qemu/{aqmp => qmp}/events.py   |  2 +-
 python/qemu/{aqmp => qmp}/legacy.py   |  0
 python/qemu/{aqmp => qmp}/message.py  |  0
 python/qemu/{aqmp => qmp}/models.py   |  0
 python/qemu/{aqmp => qmp}/protocol.py |  4 ++--
 python/qemu/{aqmp => qmp}/py.typed|  0
 python/qemu/{aqmp => qmp}/qmp_client.py   | 16 
 python/qemu/{aqmp => qmp}/qmp_shell.py|  4 ++--
 python/qemu/{aqmp => qmp}/util.py |  0
 python/qemu/utils/qemu_ga_client.py   |  4 ++--
 python/qemu/utils/qom.py  |  2 +-
 python/qemu/utils/qom_common.py   |  4 ++--
 python/qemu/utils/qom_fuse.py |  2 +-
 python/setup.cfg  |  8 
 python/tests/protocol.py  | 14 +++---
 scripts/cpu-x86-uarch-abi.py  |  2 +-
 scripts/device-crash-test |  4 ++--
 scripts/qmp/qmp-shell |  2 +-
 scripts/render_block_graph.py |  4 ++--
 scripts/simplebench/bench_block_job.py|  2 +-
 tests/qemu-iotests/iotests.py |  2 +-
 tests/qemu-iotests/tests/mirror-top-perms |  6 +++---
 29 files changed, 51 insertions(+), 51 deletions(-)
 rename python/qemu/{aqmp => qmp}/__init__.py (87%)
 rename python/qemu/{aqmp => qmp}/aqmp_tui.py (100%)
 rename python/qemu/{aqmp => qmp}/error.py (100%)
 rename python/qemu/{aqmp => qmp}/events.py (99%)
 rename python/qemu/{aqmp => qmp}/legacy.py (100%)
 rename python/qemu/{aqmp => qmp}/message.py (100%)
 rename python/qemu/{aqmp => qmp}/models.py (100%)
 rename python/qemu/{aqmp => qmp}/protocol.py (99%)
 rename python/qemu/{aqmp => qmp}/py.typed (100%)
 rename python/qemu/{aqmp => qmp}/qmp_client.py (97%)
 rename python/qemu/{aqmp => qmp}/qmp_shell.py (99%)
 rename python/qemu/{aqmp => qmp}/util.py (100%)

diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst
index ddfa9ba3f5..b0b86cc4c3 100644
--- a/python/PACKAGE.rst
+++ b/python/PACKAGE.rst
@@ -8,11 +8,11 @@ to change at any time.
 Usage
 -
 
-The ``qemu.aqmp`` subpackage provides a library for communicating with
+The ``qemu.qmp`` subpackage provides a library for communicating with
 QMP servers. The ``qemu.machine`` subpackage offers rudimentary
 facilities for launching and managing QEMU processes. Refer to each
 package's documentation
-(``>>> help(qemu.aqmp)``, ``>>> help(qemu.machine)``)
+(``>>> help(qemu.qmp)``, ``>>> help(qemu.machine)``)
 for more information.
 
 Contributing
diff --git a/python/README.rst b/python/README.rst
index eb5213337d..9c1fceaee7 100644
--- a/python/README.rst
+++ b/python/README.rst
@@ -3,7 +3,7 @@ QEMU Python Tooling
 
 This directory houses Python tooling used by the QEMU project to build,
 configure, and test QEMU. It is organized by namespace (``qemu``), and
-then by package (e.g. ``qemu/machine``, ``qemu/aqmp``, etc).
+then by package (e.g. ``qemu/machine``, ``qemu/qmp``, etc).
 
 ``setup.py`` is used by ``pip`` to install this tooling to the current
 environment. ``setup.cfg`` provides the packaging configuration used by
@@ -59,7 +59,7 @@ Package installation also normally provides executable 
console scripts,
 so that tools like ``qmp-shell`` are always available via $PATH. To
 invoke them without installation, you can invoke e.g.:
 
-``> PYTHONPATH=~/src/qemu/python python3 -m qemu.aqmp.qmp_shell``
+``> PYTHONPATH=~/src/qemu/python python3 -m qemu.qmp.qmp_shell``
 
 The mappings between console script name and python module path can be
 found in ``setup.cfg``.
diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py
index 21fb4a4f30..6e4bf6520c 100644
--- a/python/qemu/machine/machine.py
+++ b/python/qemu/machine/machine.py
@@ -40,8 +40,8 @@
 TypeVar,
 )
 
-from qemu.aqmp import SocketAddrT
-from qemu.aqmp.legacy import (
+from qemu.qmp import SocketAddrT
+from qemu.qmp.legacy import (
 QEMUMonitorProtocol,
 QMPMessage,
 QMPReturnValue,
diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py
index 817c8a5425..f29d5c1042 100644
--- a/python/qemu/machine/qtest.py
+++ b/python/qemu/machine/qtest.py
@@ -26,7 +26,7 @@
 TextIO,
 )
 
-from qemu.aqmp.protocol import SocketAddrT
+from qemu.qmp.protocol import SocketAddrT
 
 from .machine import QEMUMachi