qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Li-Wen Hsu" <lwhsu@freebsd.org>, "Kevin Wolf" <kwolf@redhat.com>,
	qemu-block@nongnu.org, "Michael Roth" <michael.roth@amd.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Ed Maste" <emaste@freebsd.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v3 00/15] python: drop qemu.qmp from qemu.git tree
Date: Tue, 9 Dec 2025 17:00:44 +0000	[thread overview]
Message-ID: <aThVvP5vwfjVa-ka@redhat.com> (raw)
In-Reply-To: <20251205060058.1503170-1-jsnow@redhat.com>

On Fri, Dec 05, 2025 at 01:00:42AM -0500, John Snow wrote:
> Hello!
> 
> This series drops the in-tree version of our python-qemu-qmp package
> ("qemu.qmp") in favor of the version hosted on PyPI, whose repository is
> located at https://gitlab.com/qemu-project/python-qemu-qmp.
> 
> GitLab CI: https://gitlab.com/jsnow/qemu/-/pipelines/2197613036
>        (FreeBSD isn't my fault...!)
> 
> The major effects of this patch series are:
> 
> 1. qemu.qmp will be installed from PyPI or vendored packages instead of
>    being utilized directly from the qemu.git tree.

This is not getting installed in enough scenarios IMHO.

My current workflow is commonly

  $ ./configure --target-list=x86_64-softmmu
  $ make
  $ ./scripts/qmp/qmp-shell-wrap 
   /var/home/berrange/src/virt/qemu/build
  Traceback (most recent call last):
    File "/var/home/berrange/src/virt/qemu/scripts/qmp/qmp-shell-wrap", line 7, in <module>
      from qemu.qmp import qmp_shell
  ModuleNotFoundError: No module named 'qemu.qmp'

Even if I add in a call to 'source build/pyvenv/bin/activate'
after 'make', I'm still missing the qemu.qmp python module.

AFAICT, qemu.qmp only gets installed in the venv if you run
'make check', and IMHO that should not be expected for the
above usage scenario.

Likewise I can no longer run any of the test programs directly
without first having run 'make check'. eg what I would currently
do is:

   $ ./configure --target-list=x86_64-softmmu
   $ make
   $ cd build/tests/qemu-iotests
   $ ./check 300

I don't generally run 'make check' as frequently as I
'configure && make' as it adds alot of time which is
not needed usually.

In general I find it tedious having to remember to run
'source build/pyvenv/bin/activate' in every terminal
window where I might want to run a QEMU script that relies
on python. It is also fairly undesirable too, as I use the
same terminal window for various purposes, that activating
the QEMU venv can interfere with non-QEMU python usage.

I would find it helpful if we provided a "run" script in the
root dir of the build directory that contained the following

  $ cat build/run
  #!/bin/sh

  set -e

  HERE=$(realpath $(dirname $0))
  source $HERE/pyvenv/bin/activate
  exec "$@"

Which would be used as a wrapper to execute scripts with the
right environment. That would let us keep the simpler workflow,
and avoid polluting the global terminal environment with the
qemu venv.

eg to be used as

   $ ./configure --target-list=x86_64-softmmu
   $ make
   $ cd build/tests/qemu-iotests
   $ ../../run ./check 300

or

  $ ./configure --target-list=x86_64-softmmu
  $ make
  $ ./build/run ./scripts/qmp/qmp-shell-wrap 



> 2. There are no new python dependencies checked or installed during
>    configure.  All test dependencies are installed post-hoc on an
>    as-needed basis.
> 3. "make check-venv" is no longer required to be run manually before any
>    test that is integrated with meson; this includes "make check" and
>    "make check-functional".
> 4. "make check-venv" no longer installs functional test dependencies: it
>    installs only the core suite of python test dependencies.
> 5. "make check-venv" is now required as a pre-requisite for running
>    device-crash-test and manually executed iotests.
> 6. Unfortunately, python3-wheel and python3-setuptools are now required
>    on the host system if tests are to be executed and >= Python 3.13 is
>    used.
> 7. An awful lot of deleted lines of code, and a lot fewer headaches
>    managing two nearly-identical copies of this source code. O:-)
> 
> Patches 1-5 are build system focused; they set up new pythondeps.toml,
> mkvenv, and meson systems in preparation for relying on an external
> qemu.qmp library, but does not yet make the switch.
> 
> Patches 6-9 are testing and CI focused; they add necessary preparation
> steps to keep tests running happily once the in-tree qemu.qmp library is
> removed.
> 
> Patches 10-15 are build system focused again; they implement the actual
> switchover to the external qemu.qmp library.

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  parent reply	other threads:[~2025-12-09 17:03 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05  6:00 [PATCH v3 00/15] python: drop qemu.qmp from qemu.git tree John Snow
2025-12-05  6:00 ` [PATCH v3 01/15] python/mkvenv: create timestamp file for each group "ensured" John Snow
2025-12-05  8:32   ` Thomas Huth
2025-12-05  6:00 ` [PATCH v3 02/15] python/mkvenv: bump 'qemu.qmp' dependency for testdeps John Snow
2025-12-05  6:00 ` [PATCH v3 03/15] python/mkvenv: add 'checktests' and 'functests' dependency groups John Snow
2025-12-05  8:47   ` Thomas Huth
2025-12-05  6:00 ` [PATCH v3 04/15] python/mkvenv: add mechanism to install local package(s) John Snow
2025-12-05  6:00 ` [PATCH v3 05/15] meson, mkvenv: add checktests and functests custom targets John Snow
2025-12-05  6:00 ` [PATCH v3 06/15] tests: Use configured python to run GitLab iotests John Snow
2025-12-05  6:00 ` [PATCH v3 07/15] tests: run "make check-venv" before running iotests John Snow
2025-12-05  6:00 ` [PATCH v3 08/15] tests: ensure "make check-venv" is run for crash tests John Snow
2025-12-05  8:53   ` Thomas Huth
2025-12-05  6:00 ` [PATCH v3 09/15] tests/lcitool: add python3 wheel and setuptools deps for qemu John Snow
2025-12-05  6:00 ` [PATCH v3 10/15] python: add vendored qemu.qmp package John Snow
2025-12-05  6:00 ` [PATCH v3 11/15] meson, mkvenv: make iotests depend on checktests group John Snow
2025-12-05  6:00 ` [PATCH v3 12/15] meson, mkvenv: make functional tests depend on functests group John Snow
2025-12-05  6:00 ` [PATCH v3 13/15] meson, mkvenv: add qemu.git/python/qemu package to pythondeps.toml John Snow
2025-12-05  6:00 ` [PATCH v3 14/15] tests: replace old "check-venv" target with meson target John Snow
2025-12-05  6:00 ` [PATCH v3 15/15] python: delete qemu.qmp John Snow
2025-12-09 16:35 ` [PATCH v3 00/15] python: drop qemu.qmp from qemu.git tree John Snow
2025-12-09 17:00 ` Daniel P. Berrangé [this message]
2025-12-09 17:23   ` John Snow
2025-12-09 19:43     ` John Snow
2025-12-09 19:46     ` Daniel P. Berrangé
2025-12-09 20:05       ` John Snow
2025-12-10 16:25         ` Daniel P. Berrangé

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=aThVvP5vwfjVa-ka@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=emaste@freebsd.org \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lwhsu@freebsd.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=michael.roth@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /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).