From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Octavian Purdila <tavip@google.com>,
qemu-devel@nongnu.org, eblake@redhat.com, armbru@redhat.com,
Paulo Neves <ptsneves@gmail.com>
Subject: Re: [PATCH] chardev: add path option for pty backend
Date: Mon, 3 Jun 2024 16:50:28 +0400 [thread overview]
Message-ID: <CAMxuvawJhdLnERBvtRvLCOJgtV727JEcdNNTSA=LUC8Vfa_reg@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_zPR=gd95tkhi8cXaZMf+M2OO2WpF=ZfO1vKhsO9=1cA@mail.gmail.com>
Hi
On Mon, Jun 3, 2024 at 4:23 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Fri, 31 May 2024 at 22:21, Octavian Purdila <tavip@google.com> wrote:
> >
> > Add path option to the pty char backend which will create a symbolic
> > link to the given path that points to the allocated PTY.
> >
> > Based on patch from Paulo Neves:
> >
> > https://patchew.org/QEMU/1548509635-15776-1-git-send-email-ptsneves@gmail.com/
> >
> > Tested with the following invocations that the link is created and
> > removed when qemu stops:
> >
> > qemu-system-x86_64 -nodefaults -mon chardev=compat_monitor \
> > -chardev pty,path=test,id=compat_monitor0
> >
> > qemu-system-x86_64 -nodefaults -monitor pty:test
> >
> > Also tested that when a link path is not passed invocations still work, e.g.:
> >
> > qemu-system-x86_64 -monitor pty
>
> Could we have some justification here for why the new
> functionality is useful, please? (e.g. what new use cases
> it permits).
>
It avoids the need to HMP/QMP query the allocated pty path. I don't
think there are other benefits.
> > --- a/qapi/char.json
> > +++ b/qapi/char.json
> > @@ -509,7 +509,7 @@
> > ##
> > # @ChardevHostdevWrapper:
> > #
> > -# @data: Configuration info for device and pipe chardevs
> > +# @data: Configuration info for device, pty and pipe chardevs
> > #
> > # Since: 1.4
> > ##
> > @@ -650,7 +650,7 @@
> > 'pipe': 'ChardevHostdevWrapper',
> > 'socket': 'ChardevSocketWrapper',
> > 'udp': 'ChardevUdpWrapper',
> > - 'pty': 'ChardevCommonWrapper',
> > + 'pty': 'ChardevHostdevWrapper',
> > 'null': 'ChardevCommonWrapper',
> > 'mux': 'ChardevMuxWrapper',
> > 'msmouse': 'ChardevCommonWrapper',
>
> Does this break QAPI compatibility?
>
> > diff --git a/qemu-options.hx b/qemu-options.hx
> > index 8ca7f34ef0..5eec194242 100644
> > --- a/qemu-options.hx
> > +++ b/qemu-options.hx
> > @@ -3569,7 +3569,7 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev,
> > "-chardev console,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> > "-chardev serial,id=id,path=path[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> > #else
> > - "-chardev pty,id=id[,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> > + "-chardev pty,id=id[,path=path][,mux=on|off][,logfile=PATH][,logappend=on|off]\n"
> > "-chardev stdio,id=id[,mux=on|off][,signal=on|off][,logfile=PATH][,logappend=on|off]\n"
> > #endif
> > #ifdef CONFIG_BRLAPI
> > @@ -3808,12 +3808,16 @@ The available backends are:
> >
> > ``path`` specifies the name of the serial device to open.
> >
> > -``-chardev pty,id=id``
> > +``-chardev pty,id=id[,path=path]``
> > Create a new pseudo-terminal on the host and connect to it. ``pty``
> > does not take any options.
>
> We just added an option, so we should delete the line saying
> that it doesn't take any options :-)
>
> >
> > ``pty`` is not available on Windows hosts.
> >
> > + ``path`` specifies the symbolic link path to be created that
> > + points to the pty device.
>
> I think we could usefully make this a little less terse. Perhaps
> If ``path`` is specified, QEMU will create a symbolic link at
> that location which points to the new PTY device.
> ?
>
> thanks
> -- PMM
>
next prev parent reply other threads:[~2024-06-03 12:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 17:51 [PATCH] chardev: add path option for pty backend Octavian Purdila
2024-06-03 9:31 ` Daniel P. Berrangé
2024-06-03 12:03 ` Marc-André Lureau
2024-06-03 12:23 ` Peter Maydell
2024-06-03 12:50 ` Marc-André Lureau [this message]
2024-06-03 12:56 ` Daniel P. Berrangé
2024-06-03 13:31 ` Peter Maydell
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='CAMxuvawJhdLnERBvtRvLCOJgtV727JEcdNNTSA=LUC8Vfa_reg@mail.gmail.com' \
--to=marcandre.lureau@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=ptsneves@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=tavip@google.com \
/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).