All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	qemu-devel@nongnu.org, Anthony Liguori <aliguori@amazon.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 04/10] vnc: switch to QemuOpts, allow multiple servers
Date: Fri, 13 Feb 2015 19:25:16 +0100	[thread overview]
Message-ID: <87k2zly8hf.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <1421067237-6955-5-git-send-email-kraxel@redhat.com> (Gerd Hoffmann's message of "Mon, 12 Jan 2015 13:53:51 +0100")

Gerd Hoffmann <kraxel@redhat.com> writes:

> This patch switches vnc over to QemuOpts, and it (more or less
> as side effect) allows multiple vnc server instances.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

I'm afraid this broke monitor command change vnc.

Reproducer

    Terminal 1:

        $ qemu -nodefaults -S -display vnc=:0 -monitor stdio
        QEMU 2.2.50 monitor - type 'help' for more information

    Terminal 2:

        $ vncviewer :0 

    Terminal 1:

        (qemu) change vnc :1

    Terminal 3:

        $ vncviewer :1

Before this patch, vncviewer works both times.  The second one kills the
first one.

After this patch, the first one still works, but the second one fails.
netstat shows nobody's listening on the port.

Speculation on possible cause inline.

Furthermore, the conversion to QemuOpts makes VNC visible in
-writeconfig, but if you -readconfig it back, it doesn't quite work.

With -display vnc=:0, -writeconfig produces

    [vnc]
      vnc = ":0"

If I append that to the config file I -readconfig, I a working VNC
display on :0 (good), but I also get an SDL display (not good).

> ---
>  include/ui/console.h |   4 +-
>  qmp.c                |  15 ++-
>  ui/vnc.c             | 270 ++++++++++++++++++++++++++++++++-------------------
>  vl.c                 |  42 +++-----
>  4 files changed, 199 insertions(+), 132 deletions(-)
>
> diff --git a/include/ui/console.h b/include/ui/console.h
> index 5ff2e27..887ed91 100644
> --- a/include/ui/console.h
> +++ b/include/ui/console.h
> @@ -328,12 +328,14 @@ void cocoa_display_init(DisplayState *ds, int full_screen);
>  
>  /* vnc.c */
>  void vnc_display_init(const char *id);
> -void vnc_display_open(const char *id, const char *display, Error **errp);
> +void vnc_display_open(const char *id, Error **errp);
>  void vnc_display_add_client(const char *id, int csock, bool skipauth);
>  char *vnc_display_local_addr(const char *id);
>  #ifdef CONFIG_VNC
>  int vnc_display_password(const char *id, const char *password);
>  int vnc_display_pw_expire(const char *id, time_t expires);
> +QemuOpts *vnc_parse_func(const char *str);
> +int vnc_init_func(QemuOpts *opts, void *opaque);
>  #else
>  static inline int vnc_display_password(const char *id, const char *password)
>  {
> diff --git a/qmp.c b/qmp.c
> index 0b4f131..963305c 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -368,7 +368,20 @@ void qmp_change_vnc_password(const char *password, Error **errp)
>  
>  static void qmp_change_vnc_listen(const char *target, Error **errp)
>  {
> -    vnc_display_open(NULL, target, errp);
> +    QemuOptsList *olist = qemu_find_opts("vnc");
> +    QemuOpts *opts;
> +
> +    if (strstr(target, "id=")) {
> +        error_setg(errp, "id not supported");
> +        return;
> +    }

Aside: this is unclean.  Could we somehow test qemu_opts_id() instead?

> +

This deletes the QemuOpts with id=default:

> +    opts = qemu_opts_find(olist, "default");
> +    if (opts) {
> +        qemu_opts_del(opts);
> +    }

But this creates one without id:

> +    opts = vnc_parse_func(target);

The first argument orders vnc_display_open() to look for QemuOpts with
id=default, which doesn't exist anymore:

> +    vnc_display_open("default", errp);

>  }
>  
>  static void qmp_change_vnc(const char *target, bool has_arg, const char *arg,
[...]

  reply	other threads:[~2015-02-13 18:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 12:53 [Qemu-devel] [PATCH 00/10] vnc: add support for multiple vnc displays Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 01/10] vnc: remove vnc_display global Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 02/10] vnc: remove unused DisplayState parameter, add id instead Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 03/10] vnc: add display id to acl names Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 04/10] vnc: switch to QemuOpts, allow multiple servers Gerd Hoffmann
2015-02-13 18:25   ` Markus Armbruster [this message]
2015-02-17  8:50     ` Gerd Hoffmann
2015-02-17  8:58     ` Gerd Hoffmann
2015-02-17 12:15       ` Markus Armbruster
2015-02-13 18:30   ` Markus Armbruster
2015-01-12 12:53 ` [Qemu-devel] [PATCH 05/10] vnc: allow binding servers to qemu consoles Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 06/10] vnc: update docs/multiseat.txt Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 07/10] vnc: track & limit connections Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 08/10] vnc: factor out qmp_query_client_list Gerd Hoffmann
2015-01-12 12:53 ` [Qemu-devel] [PATCH 09/10] monitor: add query-vnc-servers command Gerd Hoffmann
2015-02-13 19:44   ` Eric Blake
2015-01-12 12:53 ` [Qemu-devel] [PATCH 10/10] monitor: add vnc websockets Gerd Hoffmann
2015-02-13 19:45   ` Eric Blake

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=87k2zly8hf.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=kraxel@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.