All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Blake <eblake@redhat.com>, QEMU <qemu-devel@nongnu.org>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH 2/2] qapi/ui: introduce change-vnc-listen
Date: Tue, 21 Dec 2021 12:13:54 +0400	[thread overview]
Message-ID: <CAJ+F1C+v1d49KT9+4n3RiDXfjj+82k7wz3rO_5=LVJ_T5Kn3vg@mail.gmail.com> (raw)
In-Reply-To: <20211220154418.1554279-3-vsementsov@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 3087 bytes --]

Hi

On Mon, Dec 20, 2021 at 10:24 PM Vladimir Sementsov-Ogievskiy <
vsementsov@virtuozzo.com> wrote:

> Add command that can change addresses where VNC server listens for new
> connections. Prior to 6.0 this functionality was available through
> 'change' qmp command which was deleted.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>

Looks good to me,
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Could you write an avocado test for it? (tests/avocado/vnc.py)

---
>  docs/about/removed-features.rst |  3 ++-
>  qapi/ui.json                    | 12 ++++++++++++
>  ui/vnc.c                        | 26 ++++++++++++++++++++++++++
>  3 files changed, 40 insertions(+), 1 deletion(-)
>
> diff --git a/docs/about/removed-features.rst
> b/docs/about/removed-features.rst
> index d42c3341de..20e6901a82 100644
> --- a/docs/about/removed-features.rst
> +++ b/docs/about/removed-features.rst
> @@ -348,7 +348,8 @@ documentation of ``query-hotpluggable-cpus`` for
> additional details.
>  ``change`` (removed in 6.0)
>  '''''''''''''''''''''''''''
>
> -Use ``blockdev-change-medium`` or ``change-vnc-password`` instead.
> +Use ``blockdev-change-medium`` or ``change-vnc-password`` or
> +``change-vnc-listen`` instead.
>
>  ``query-events`` (removed in 6.0)
>  '''''''''''''''''''''''''''''''''
> diff --git a/qapi/ui.json b/qapi/ui.json
> index d7567ac866..14e6fe0b4c 100644
> --- a/qapi/ui.json
> +++ b/qapi/ui.json
> @@ -1304,3 +1304,15 @@
>  { 'command': 'display-reload',
>    'data': 'DisplayReloadOptions',
>    'boxed' : true }
> +
> +##
> +# @change-vnc-listen:
> +#
> +# Change set of addresses to listen for connections.
> +#
> +# Since: 7.0
> +#
> +##
> +{ 'command': 'change-vnc-listen',
> +  'data': { 'id': 'str', 'addresses': ['SocketAddress'],
> +            '*websockets': ['SocketAddress'] } }
> diff --git a/ui/vnc.c b/ui/vnc.c
> index c9e26c70df..69bbf3b6f6 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -4212,6 +4212,32 @@ fail:
>      vnc_display_close(vd);
>  }
>
> +void qmp_change_vnc_listen(const char *id, SocketAddressList *addresses,
> +                           bool has_websockets, SocketAddressList
> *websockets,
> +                           Error **errp)
> +{
> +    VncDisplay *vd = vnc_display_find(id);
> +
> +    if (!vd) {
> +        error_setg(errp, "VNC display '%s' not active", id);
> +        return;
> +    }
> +
> +    if (vd->listener) {
> +        qio_net_listener_disconnect(vd->listener);
> +        object_unref(OBJECT(vd->listener));
> +    }
> +    vd->listener = NULL;
> +
> +    if (vd->wslistener) {
> +        qio_net_listener_disconnect(vd->wslistener);
> +        object_unref(OBJECT(vd->wslistener));
> +    }
> +    vd->wslistener = NULL;
> +
> +    vnc_display_listen(vd, addresses, websockets, errp);
> +}
> +
>  void vnc_display_add_client(const char *id, int csock, bool skipauth)
>  {
>      VncDisplay *vd = vnc_display_find(id);
> --
> 2.31.1
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 4463 bytes --]

  reply	other threads:[~2021-12-21  8:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 15:44 [PATCH 0/2] qapi/ui: add change-vnc-listen Vladimir Sementsov-Ogievskiy
2021-12-20 15:44 ` [PATCH 1/2] ui/vnc: refactor arrays of addresses to SocketAddressList Vladimir Sementsov-Ogievskiy
2021-12-21  7:56   ` Marc-André Lureau
2021-12-20 15:44 ` [PATCH 2/2] qapi/ui: introduce change-vnc-listen Vladimir Sementsov-Ogievskiy
2021-12-21  8:13   ` Marc-André Lureau [this message]
2021-12-21 13:35     ` Vladimir Sementsov-Ogievskiy
2021-12-21 14:15   ` Markus Armbruster
2021-12-21 14:41     ` Vladimir Sementsov-Ogievskiy
2022-01-04 13:21   ` Daniel P. Berrangé
2022-01-13 16:27     ` Markus Armbruster
2022-01-13 16:30       ` Daniel P. Berrangé
2021-12-21 13:37 ` [PATCH 3/2] avocado/vnc: add test_change_listen Vladimir Sementsov-Ogievskiy
2021-12-21 13:45   ` 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='CAJ+F1C+v1d49KT9+4n3RiDXfjj+82k7wz3rO_5=LVJ_T5Kn3vg@mail.gmail.com' \
    --to=marcandre.lureau@gmail.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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 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.