[PATCH 0/3] qga: Add optional stream-output argument to guest-exec

Daniel Xu posted 3 patches 10 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/cover.1695034158.git.dxu@dxuuu.xyz
Maintainers: Michael Roth <michael.roth@amd.com>, Konstantin Kostiuk <kkostiuk@redhat.com>
qga/commands.c        | 16 +++++++--
qga/qapi-schema.json  |  7 +++-
tests/unit/test-qga.c | 77 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 97 insertions(+), 3 deletions(-)
[PATCH 0/3] qga: Add optional stream-output argument to guest-exec
Posted by Daniel Xu 10 months ago
Currently, commands run through guest-exec are "silent" until they
finish running. This is fine for short lived commands. But for commands
that take a while, this is a bad user experience.

Usually long running programs know that they will run for a while. To
improve user experience, they will typically print some kind of status
to output at a regular interval. So that the user knows that their
command isn't just hanging.

This patchset adds support for an optional stream-output parameter to
guest-exec. This causes subsequent calls to guest-exec-status to return
all buffered output. This allows downstream applications to be able to
relay "status" to the end user.

I also uncovered a latent memory leak bug with the added unit test. The
fix is in commit 1.


Daniel Xu (3):
  qga: Fix memory leak when output stream is unused
  qga: Add optional stream-output argument to guest-exec
  qga: test: Add test for guest-exec stream-output

 qga/commands.c        | 16 +++++++--
 qga/qapi-schema.json  |  7 +++-
 tests/unit/test-qga.c | 77 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 97 insertions(+), 3 deletions(-)

-- 
2.41.0