All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: John Snow <jsnow@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Thomas Huth <thuth@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: Async machine appliance for testing (python)
Date: Wed, 2 Sep 2026 18:50:49 +0100	[thread overview]
Message-ID: <aphh-XHBjGicZDD7@redhat.com> (raw)
In-Reply-To: <CAFn=p-aVpKptC=G6yTWWuQoeG+peChgw60uJdOXr7B8r=m=iBQ@mail.gmail.com>

On Mon, Aug 31, 2026 at 04:51:36PM -0400, John Snow wrote:
> WIth the upgrade to 3.12 imminent, now might be a good time for me to
> revisit the work I started when I converted QMP from sync to an async
> library. I have a draft of the library I wrote some time ago, but it's
> probably in somewhat dodgy shape after a year or two of being ignored.
> 
> Before I dig in, I wanted to ask if this would be a helpful project.
> The main selling points would be:
> 
> (1) Ability to split it out from the main QEMU tree, like QMP was, for
> use in external testing
> (2) Better stream management so console information is consumed and
> logged reliably without deadlocks due to pipes hitting their buffer
> limit

I can't remember the specific details, but I do recall some
scenarios where it would have been valuable to have the console
output continuously streamed to the log file on disk, while
at the same time retainining the ability to do expected
output matching from the API.

> (3) Removing multiprocess and multithread processing of console and
> stdout/stderr logging from test suites in favor of using async
> user-threads for (hopefully) simpler, more straightforward processing
> and customization.

Which tests were you refering to here ?  I didn't think we had
python tests using multiprocess/multithread ?

Tangentially related, in debugging failures of the functional
test suite, and to a lesser extent I/O tests / qmp-shell, I've
often found myself heavily confused by the asyncio call paths
and control flow, making it really hard to debug.

In particular I've never fully figured out how to get qmp-shell
to have a clean exit path without stack traces being thrown.

I'm unclear if this is related to our having QEMUMachine class
expose a sync API on top of an async QMP class (square peg in
a round hole situation), or if this is just something inherent
to Python asyncio APIs, or probably a bit of both ?

If switching to a fully async API throughout the stack makes
debugging simpler, I'd welcome it.

> (4) Ability to add listeners/event handlers to watch for specific
> patterns and trigger asynchronously when they occur; i.e. ability to
> handle and watch for specific patterns in an arbitrary order without
> deadlocking your test
> (5) Centralized timeout setting and handling.

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|



  parent reply	other threads:[~2026-09-02 17:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 20:51 Async machine appliance for testing (python) John Snow
2026-09-02  9:35 ` Gerd Hoffmann
2026-09-02 17:29   ` John Snow
2026-09-02 17:50 ` Daniel P. Berrangé [this message]
2026-09-02 18:25   ` 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=aphh-XHBjGicZDD7@redhat.com \
    --to=berrange@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kraxel@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.