]> git.proxmox.com Git - mirror_qemu.git/commit
chardev: Allow setting file chardev input file on the command line
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 13 Apr 2023 15:07:24 +0000 (16:07 +0100)
committerThomas Huth <thuth@redhat.com>
Thu, 20 Apr 2023 04:50:11 +0000 (06:50 +0200)
commit5b18a6bf44b93122ba6638d227153cd146a68973
tree27b3f75564fcaab8338c00e9d3c6489b7023ee60
parent537a1388e65a784ac21eaf1639222e6332357b2f
chardev: Allow setting file chardev input file on the command line

Our 'file' chardev backend supports both "output from this chardev
is written to a file" and "input from this chardev should be read
from a file" (except on Windows). However, you can only set up
the input file if you're using the QMP interface -- there is no
command line syntax to do it.

Add command line syntax to allow specifying an input file
as well as an output file, using a new 'input-path' suboption.

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.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20230413150724.404304-3-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[thuth: Replace "input-file=" typo with "input-path="]
Signed-off-by: Thomas Huth <thuth@redhat.com>
chardev/char-file.c
chardev/char.c
qemu-options.hx