[PATCH v3 0/3] qapi/ui: change vnc addresses

Vladimir Sementsov-Ogievskiy posted 3 patches 2 years, 3 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220118160909.2502374-1-vsementsov@virtuozzo.com
Maintainers: Cleber Rosa <crosa@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Markus Armbruster <armbru@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Eric Blake <eblake@redhat.com>, Beraldo Leal <bleal@redhat.com>, Wainer dos Santos Moschetta <wainersm@redhat.com>
There is a newer version of this series
docs/about/removed-features.rst |   3 +-
qapi/ui.json                    |   6 +-
include/ui/console.h            |   2 +-
monitor/qmp-cmds.c              |   4 +-
ui/vnc.c                        | 166 ++++++++++++++++----------------
tests/avocado/vnc.py            |  10 ++
6 files changed, 100 insertions(+), 91 deletions(-)
[PATCH v3 0/3] qapi/ui: change vnc addresses
Posted by Vladimir Sementsov-Ogievskiy 2 years, 3 months ago
Hi all!

v3: - instead of creating new qmp command add an argument to existing
      display-reload
    - also don't touch websockets for now. I'm not sure we need it.
      Additional argument for changing websockets may be added later on
      demand

Recently our customer requested a possibility to change VNC listen port
dynamically.

Happily in Rhel7-based Qemu we already have this possibility: through
deprecated "change" qmp command.

But since 6.0 "change" qmp command was removed, with recommendation to
use change-vnc-password or blockdev-change-medium instead. Of course,
neither of them allow change VNC listen port.

So, let's reimplement the possibility.

Note: now, reconnecting may trigger existing deadlock, as I described
in my message "Re: [PULL 09/11] ui/vnc: clipboard support":
 <973ddebe-14a9-4ba7-c389-7a97d6017237@virtuozzo.com>

Simple hack helps, but I'm not sure it's safe itself:

    diff --git a/ui/vnc.c b/ui/vnc.c
    index 69bbf3b6f6..8c6b378e2e 100644
    --- a/ui/vnc.c
    +++ b/ui/vnc.c
    @@ -1354,12 +1354,12 @@ void vnc_disconnect_finish(VncState *vs)
             /* last client gone */
             vnc_update_server_surface(vs->vd);
         }
    +    vnc_unlock_output(vs);
    +
         if (vs->cbpeer.update.notify) {
             qemu_clipboard_peer_unregister(&vs->cbpeer);
         }
     
    -    vnc_unlock_output(vs);
    -
         qemu_mutex_destroy(&vs->output_mutex);
         if (vs->bh != NULL) {
             qemu_bh_delete(vs->bh);

Vladimir Sementsov-Ogievskiy (3):
  ui/vnc: refactor arrays of addresses to SocketAddressList
  qapi/ui: display-reload: add possibility to change listen address
  avocado/vnc: add test_change_listen

 docs/about/removed-features.rst |   3 +-
 qapi/ui.json                    |   6 +-
 include/ui/console.h            |   2 +-
 monitor/qmp-cmds.c              |   4 +-
 ui/vnc.c                        | 166 ++++++++++++++++----------------
 tests/avocado/vnc.py            |  10 ++
 6 files changed, 100 insertions(+), 91 deletions(-)

-- 
2.31.1


Re: [PATCH v3 0/3] qapi/ui: change vnc addresses
Posted by Vladimir Sementsov-Ogievskiy 2 years, 2 months ago
Ping)

18.01.2022 19:09, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> v3: - instead of creating new qmp command add an argument to existing
>        display-reload
>      - also don't touch websockets for now. I'm not sure we need it.
>        Additional argument for changing websockets may be added later on
>        demand
> 
> Recently our customer requested a possibility to change VNC listen port
> dynamically.
> 
> Happily in Rhel7-based Qemu we already have this possibility: through
> deprecated "change" qmp command.
> 
> But since 6.0 "change" qmp command was removed, with recommendation to
> use change-vnc-password or blockdev-change-medium instead. Of course,
> neither of them allow change VNC listen port.
> 
> So, let's reimplement the possibility.
> 
> Note: now, reconnecting may trigger existing deadlock, as I described
> in my message "Re: [PULL 09/11] ui/vnc: clipboard support":
>   <973ddebe-14a9-4ba7-c389-7a97d6017237@virtuozzo.com>
> 
> Simple hack helps, but I'm not sure it's safe itself:
> 
>      diff --git a/ui/vnc.c b/ui/vnc.c
>      index 69bbf3b6f6..8c6b378e2e 100644
>      --- a/ui/vnc.c
>      +++ b/ui/vnc.c
>      @@ -1354,12 +1354,12 @@ void vnc_disconnect_finish(VncState *vs)
>               /* last client gone */
>               vnc_update_server_surface(vs->vd);
>           }
>      +    vnc_unlock_output(vs);
>      +
>           if (vs->cbpeer.update.notify) {
>               qemu_clipboard_peer_unregister(&vs->cbpeer);
>           }
>       
>      -    vnc_unlock_output(vs);
>      -
>           qemu_mutex_destroy(&vs->output_mutex);
>           if (vs->bh != NULL) {
>               qemu_bh_delete(vs->bh);
> 
> Vladimir Sementsov-Ogievskiy (3):
>    ui/vnc: refactor arrays of addresses to SocketAddressList
>    qapi/ui: display-reload: add possibility to change listen address
>    avocado/vnc: add test_change_listen
> 
>   docs/about/removed-features.rst |   3 +-
>   qapi/ui.json                    |   6 +-
>   include/ui/console.h            |   2 +-
>   monitor/qmp-cmds.c              |   4 +-
>   ui/vnc.c                        | 166 ++++++++++++++++----------------
>   tests/avocado/vnc.py            |  10 ++
>   6 files changed, 100 insertions(+), 91 deletions(-)
> 


-- 
Best regards,
Vladimir