mbox series

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

Message ID 20230413150724.404304-1-peter.maydell@linaro.org
Headers show
Series chardev/char-file: Allow setting input file on command line | expand

Message

Peter Maydell April 13, 2023, 3:07 p.m. UTC
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(-)