On Tue, Jan 18, 2022 at 06:13:48AM +0100, Philippe Mathieu-Daudé wrote:
> On 18/1/22 00:27, John Snow wrote:
> > On Mon, Jan 17, 2022 at 9:11 AM Daniel P. Berrangé <berra...@redhat.com> 
> > wrote:
> > > 
> > > With the current 'qmp-shell' tool developers must first spawn QEMU with
> > > a suitable -qmp arg and then spawn qmp-shell in a separate terminal
> > > pointing to the right socket.
> > > 
> > > With 'qmp-shell-wrap' developers can ignore QMP sockets entirely and
> > > just pass the QEMU command and arguments they want. The program will
> > > listen on a UNIX socket and tell QEMU to connect QMP to that.
> > > 
> > > For example, this:
> > > 
> > >   # qmp-shell-wrap -- qemu-system-x86_64 -display none
> > > 
> > > Is roughly equivalent of running:
> > > 
> > >   # qemu-system-x86_64 -display none -qmp qmp-shell-1234 &
> > >   # qmp-shell qmp-shell-1234
> > > 
> > > Except that 'qmp-shell-wrap' switches the socket peers around so that
> > > it is the UNIX socket server and QEMU is the socket client. This makes
> > > QEMU reliably go away when qmp-shell-wrap exits, closing the server
> > > socket.
> > > 
> > > Signed-off-by: Daniel P. Berrangé <berra...@redhat.com>
> > > ---
> > >   python/qemu/qmp/qmp_shell.py | 61 +++++++++++++++++++++++++++++++++---
> > >   scripts/qmp/qmp-shell-wrap   | 11 +++++++
> > >   2 files changed, 68 insertions(+), 4 deletions(-)
> > >   create mode 100755 scripts/qmp/qmp-shell-wrap
> 
> > > diff --git a/scripts/qmp/qmp-shell-wrap b/scripts/qmp/qmp-shell-wrap
> > > new file mode 100755
> > > index 0000000000..9e94da114f
> > > --- /dev/null
> > > +++ b/scripts/qmp/qmp-shell-wrap
> > > @@ -0,0 +1,11 @@
> > > +#!/usr/bin/env python3
> > > +
> > > +import os
> > > +import sys
> > > +
> > > +sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 
> > > 'python'))
> > > +from qemu.qmp import qmp_shell
> > > +
> > > +
> > > +if __name__ == '__main__':
> > > +    qmp_shell.main_wrap()
> > > --
> > > 2.33.1
> > > 
> > 
> > Adds some new failures to the python linters; try "make check-dev" in
> > the python sub-dir.
> > 
> > ... Though, due to a bug in avocado, this helpfully doesn't actually
> > show you the failure output right now ...
> > 
> > making this little edit should fix that, sorry for the inconvenience here.
> > 
> > diff --git a/python/avocado.cfg b/python/avocado.cfg
> > index c7722e7ecd..a460420059 100644
> > --- a/python/avocado.cfg
> > +++ b/python/avocado.cfg
> > @@ -1,5 +1,5 @@
> >   [run]
> > -test_runner = runner
> > +test_runner = nrunner
> 
> Cc'ing Beraldo, Willian once told me the nrunner switch was scheduled
> for QEMU next release.

Thanks Philippe, for the Cc.

We solved a few issues on the nrunner side recently and implemented a
set of changes regarding the logging logic aimed to improve the
debugging process.

Currently, our legacy runner ('runner') is in "dismantle mode," and its
usage with the latest versions of Avocado is discouraged.

Because of the nrunner's new architecture and how Coverage works [1], we
spotted an issue when using nrunner + Coverage [2]. We are also
investigating a possible alternative [3] in parallel.

[1] - https://coverage.readthedocs.io/en/stable/subprocess.html
[2] - https://github.com/avocado-framework/avocado/issues/4765
[3] - 
https://gitlab.com/beraldoleal/qemu/-/commit/c7aeb34505aab4357421890575cc9ddd7e83d04f

--
Beraldo


Reply via email to