qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>, qemu-devel@nongnu.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	armbru@redhat.com, Paolo Bonzini <pbonzini@redhat.com>,
	"open list:X86" <xen-devel@lists.xenproject.org>,
	Anthony Perard <anthony.perard@citrix.com>
Subject: Re: [Qemu-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor
Date: Wed, 22 Aug 2018 13:26:38 -0500	[thread overview]
Message-ID: <82e691b4-c2fe-5b68-91d8-ab2dd90ce691@redhat.com> (raw)
In-Reply-To: <20180822180259.26365-1-marcandre.lureau@redhat.com>

On 08/22/2018 01:02 PM, Marc-André Lureau wrote:
> This is mostly for readability of the code. Let's make it clear which
> callers can create an implicit monitor when the chardev is muxed.
> 
> This will also enforce a safer behaviour, as we don't really support
> creating monitor anywhere/anytime at the moment.
> 
> There are documented cases, such as: -serial/-parallel/-virtioconsole
> and to less extent -debugcon.
> 
> Less obvious and questionnable ones are -gdb and Xen console. Add a

s/questionnable/questionable/

> FIXME note for those, but keep the support for now.
> 
> Other qemu_chr_new() callers either have a fixed parameter/filename
> string, or do preliminary checks on the string (such as slirp), or do
> not need it, such as -qtest.
> 
> On a related note, the list of monitor creation places:
> 
> - the chardev creators listed above: all from command line (except
>    perhaps Xen console?)
> 
> - -gdb & hmp gdbserver will create a "GDB monitor command" chardev
>    that is wired to an HMP monitor.
> 
> - -mon command line option
> 
>>From this short study, I would like to think that a monitor may only
> be created in the main thread today, though I remain skeptical :)
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   include/chardev/char.h | 18 +++++++++++++++++-
>   chardev/char.c         | 21 +++++++++++++++++----
>   gdbstub.c              |  6 +++++-
>   hw/char/xen_console.c  |  5 ++++-
>   vl.c                   |  8 ++++----
>   5 files changed, 47 insertions(+), 11 deletions(-)
> 
> diff --git a/include/chardev/char.h b/include/chardev/char.h
> index 6f0576e214..be2b9b817e 100644
> --- a/include/chardev/char.h
> +++ b/include/chardev/char.h
> @@ -105,6 +105,7 @@ ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts,
>    * @qemu_chr_new:
>    *
>    * Create a new character backend from a URI.
> + * Do not implicitely initialize a monitor if the chardev is muxed.

s/implicitely/implicitly/

>    *
>    * @label the name of the backend
>    * @filename the URI
> @@ -113,6 +114,19 @@ ChardevBackend *qemu_chr_parse_opts(QemuOpts *opts,
>    */
>   Chardev *qemu_chr_new(const char *label, const char *filename);
>   
> +/**
> + * @qemu_chr_new_mux_mon:
> + *
> + * Create a new character backend from a URI.
> + * Implicitely initialize a monitor if the chardev is muxed.

and again

> +++ b/gdbstub.c
> @@ -2038,7 +2038,11 @@ int gdbserver_start(const char *device)
>               sigaction(SIGINT, &act, NULL);
>           }
>   #endif
> -        chr = qemu_chr_new_noreplay("gdb", device);
> +        /*
> +         * FIXME: it's a bit weird to allow using a mux chardev here
> +         * and setup implicitely a monitor. We may want to break this.

s/setup implicitely/implicitly set up/

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

  reply	other threads:[~2018-08-22 18:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-22 18:02 [Qemu-devel] [PATCH] RFC: chardev: mark the calls that allow an implicit mux monitor Marc-André Lureau
2018-08-22 18:26 ` Eric Blake [this message]
2018-08-24  7:33 ` Markus Armbruster
2018-08-24 14:08   ` Marc-André Lureau
2018-08-27  8:10     ` Markus Armbruster
2018-08-27 21:48       ` 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=82e691b4-c2fe-5b68-91d8-ab2dd90ce691@redhat.com \
    --to=eblake@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=armbru@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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).