qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Laurent Vivier" <laurent@vivier.eu>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH 2/2] chardev: Allow setting file chardev input file on the command line
Date: Fri, 14 Apr 2023 16:52:21 +0200	[thread overview]
Message-ID: <c9233c89-4027-fac5-6155-a72e16ae118c@redhat.com> (raw)
In-Reply-To: <20230413150724.404304-3-peter.maydell@linaro.org>

On 13/04/2023 17.07, Peter Maydell wrote:
> 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>
> ---
...
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 59bdf67a2c5..31d08c60264 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -3360,7 +3360,7 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
>       "-chardev vc,id=id[[,width=width][,height=height]][[,cols=cols][,rows=rows]]\n"
>       "         [,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
>       "-chardev ringbuf,id=id[,size=size][,logfile=PATH][,logappend=on|off]\n"
> -    "-chardev file,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> +    "-chardev file,id=id,path=path[,input-file=input-file][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"

s/input-file=/input-path=/

  Thomas



  parent reply	other threads:[~2023-04-14 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 15:07 [PATCH 0/2] chardev/char-file: Allow setting input file on command line Peter Maydell
2023-04-13 15:07 ` [PATCH 1/2] qtest: Don't assert on "-qtest chardev:myid" Peter Maydell
2023-04-14 14:50   ` Thomas Huth
2023-04-14 19:01   ` Marc-André Lureau
2023-04-13 15:07 ` [PATCH 2/2] chardev: Allow setting file chardev input file on the command line Peter Maydell
2023-04-14 14:03   ` Philippe Mathieu-Daudé
2023-04-14 14:21     ` Peter Maydell
2023-04-14 14:52   ` Thomas Huth [this message]
2023-04-14 19:33   ` Marc-André Lureau

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=c9233c89-4027-fac5-6155-a72e16ae118c@redhat.com \
    --to=thuth@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).