qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Hanna Reitz" <hreitz@redhat.com>,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Cleber Rosa" <crosa@redhat.com>,
	qemu-block@nongnu.org, "John Snow" <jsnow@redhat.com>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>
Subject: [PATCH 00/14] python: misc cleanups for python code
Date: Tue, 15 Jul 2025 15:30:09 +0100	[thread overview]
Message-ID: <20250715143023.1851000-1-berrange@redhat.com> (raw)

This spun out of understanding why we didn't get prior warning
about our use of the deprecated 'asyncio.get_event_loop' feature.
The answer is that python doesn't print any deprecation messages
by default unless directly triggered by the __main__ module.

So here I wanted to get all python warning messages enabled for
the iotests and functional tests, so we get a heads up of any
other failures coming out way.

In doing this it uncovered numerous places where we failed to
cleanup with dangling file handles.

I further uncovered lots of old compat code for py3.6 which
we stopped needing a long while ago.

I'm in two minds over whether the very last commit is suitable
or not though.  The iotests do strict comparison of stdout /
stderr, so if we allow python warnings to appear that will
break the iotests. At the same time though we do really want
to see these warnings, especially when developers run the
iotests manually, so just turning them on in CI is not very
desirable. So wondering how to get the warnings for devs but
not for users running from released tarballs?

Also note that I ran 'check', 'check -qcow' and 'check -nbd'
but this doesn't cover all possible iotest usage. So there
might still be some resource leaks hiding in there which will
cause failures for devs running tests with unusual config
scenarios.


Daniel P. Berrangé (13):
  python: avoid deprecation warning with get_event_loop
  python: drop 'is_closing' back compat helper
  python: drop 'wait_closed' back compat helper
  python: drop 'asyncio_run' back compat helper
  python: drop 'create_task' back compat helper
  iotests: drop compat for old version context manager
  functional: ensure log handlers are closed
  functional: ensure sockets and files are closed
  functional: always enable all python warnings
  python: ensure QEMUQtestProtocol closes its socket
  iotests/147: ensure temporary sockets are closed before exiting
  iotests/151: ensure subprocesses are cleaned up
  iotests/check: always enable all python warnings

Richard W.M. Jones (1):
  python: Replace asyncio.get_event_loop for Python 3.14

 python/qemu/machine/qtest.py           |  2 +
 python/qemu/qmp/legacy.py              | 10 ++-
 python/qemu/qmp/protocol.py            | 13 ++--
 python/qemu/qmp/qmp_tui.py             | 10 +--
 python/qemu/qmp/util.py                | 97 +-------------------------
 python/tests/protocol.py               |  9 ++-
 tests/functional/qemu_test/testcase.py |  6 ++
 tests/functional/test_multiprocess.py  |  3 +
 tests/functional/test_virtio_gpu.py    |  2 +
 tests/qemu-iotests/147                 |  1 +
 tests/qemu-iotests/151                 |  5 ++
 tests/qemu-iotests/check               |  4 ++
 tests/qemu-iotests/testenv.py          |  7 +-
 tests/qemu-iotests/testrunner.py       |  9 +--
 14 files changed, 51 insertions(+), 127 deletions(-)

-- 
2.49.0



             reply	other threads:[~2025-07-15 15:08 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-15 14:30 Daniel P. Berrangé [this message]
2025-07-15 14:30 ` [PATCH 01/14] python: Replace asyncio.get_event_loop for Python 3.14 Daniel P. Berrangé
2025-08-19 19:47   ` John Snow
2025-08-19 19:51     ` Daniel P. Berrangé
2025-08-19 20:00       ` John Snow
2025-07-15 14:30 ` [PATCH 02/14] python: avoid deprecation warning with get_event_loop Daniel P. Berrangé
2025-07-23 21:24   ` Eric Blake
2025-08-19 19:49     ` John Snow
2025-08-19 19:52       ` Daniel P. Berrangé
2025-07-15 14:30 ` [PATCH 03/14] python: drop 'is_closing' back compat helper Daniel P. Berrangé
2025-07-24 12:44   ` Alex Bennée
2025-08-19 19:56   ` John Snow
2025-07-15 14:30 ` [PATCH 04/14] python: drop 'wait_closed' " Daniel P. Berrangé
2025-08-19 19:56   ` John Snow
2025-07-15 14:30 ` [PATCH 05/14] python: drop 'asyncio_run' " Daniel P. Berrangé
2025-08-19 19:57   ` John Snow
2025-07-15 14:30 ` [PATCH 06/14] python: drop 'create_task' " Daniel P. Berrangé
2025-08-19 19:57   ` John Snow
2025-07-15 14:30 ` [PATCH 07/14] iotests: drop compat for old version context manager Daniel P. Berrangé
2025-08-19 20:04   ` John Snow
2025-07-15 14:30 ` [PATCH 08/14] functional: ensure log handlers are closed Daniel P. Berrangé
2025-07-15 14:50   ` Thomas Huth
2025-07-15 14:30 ` [PATCH 09/14] functional: ensure sockets and files " Daniel P. Berrangé
2025-07-15 15:03   ` Thomas Huth
2025-07-15 15:12     ` Daniel P. Berrangé
2025-07-15 15:14       ` Thomas Huth
2025-07-15 14:30 ` [PATCH 10/14] functional: always enable all python warnings Daniel P. Berrangé
2025-07-15 15:15   ` Thomas Huth
2025-08-19 20:08     ` John Snow
2025-07-15 14:30 ` [PATCH 11/14] python: ensure QEMUQtestProtocol closes its socket Daniel P. Berrangé
2025-08-19 20:12   ` John Snow
2025-08-19 20:29     ` Daniel P. Berrangé
2025-07-15 14:30 ` [PATCH 12/14] iotests/147: ensure temporary sockets are closed before exiting Daniel P. Berrangé
2025-08-19 21:37   ` John Snow
2025-07-15 14:30 ` [PATCH 13/14] iotests/151: ensure subprocesses are cleaned up Daniel P. Berrangé
2025-08-19 21:37   ` John Snow
2025-08-20  9:45     ` Daniel P. Berrangé
2025-07-15 14:30 ` [PATCH 14/14] iotests/check: always enable all python warnings Daniel P. Berrangé
2025-08-20  5:03   ` 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=20250715143023.1851000-1-berrange@redhat.com \
    --to=berrange@redhat.com \
    --cc=crosa@redhat.com \
    --cc=elena.ufimtseva@oracle.com \
    --cc=hreitz@redhat.com \
    --cc=jag.raman@oracle.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@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).