[PATCH 0/2] chardev/char-file: Allow setting input file on command line

Peter Maydell posted 2 patches 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230413150724.404304-1-peter.maydell@linaro.org
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>
chardev/char-file.c |  8 ++++++++
chardev/char.c      |  3 +++
softmmu/qtest.c     |  2 +-
qemu-options.hx     | 10 ++++++++--
4 files changed, 20 insertions(+), 3 deletions(-)
[PATCH 0/2] chardev/char-file: Allow setting input file on command line
Posted by Peter Maydell 1 year ago
Our 'file' chardev backend supports specifying both an
input and an output file, but only if you create it via
the QMP interface -- there is no command-line syntax
support for setting the input file. This patchset adds
an extra 'input-path' option to the chardev.

The specific use case I have is that I'd like to be able to
feed fuzzer reproducer input into qtest without having to use
'-qtest stdio' and put the input onto stdin. Being able to
use a file chardev like this:
 -chardev file,id=repro,path=/dev/null,input-path=repro.txt -qtest chardev:repro
means that stdio is free for use by gdb.

The first patch in the series fixes an assertion failure
in the qtest code if you try to pass it a named chardev;
the second patch adds the new option to the file backend.

thanks
-- PMM

Peter Maydell (2):
  qtest: Don't assert on "-qtest chardev:myid"
  chardev: Allow setting file chardev input file on the command line

 chardev/char-file.c |  8 ++++++++
 chardev/char.c      |  3 +++
 softmmu/qtest.c     |  2 +-
 qemu-options.hx     | 10 ++++++++--
 4 files changed, 20 insertions(+), 3 deletions(-)

-- 
2.34.1