qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow UNIX socket for VNC websocket
@ 2023-07-23 21:03 Sergii Zasenko
  2023-07-24  8:08 ` Marc-André Lureau
  2023-07-24  8:49 ` Daniel P. Berrangé
  0 siblings, 2 replies; 6+ messages in thread
From: Sergii Zasenko @ 2023-07-23 21:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sergii Zasenko

Signed-off-by: Sergii Zasenko <sergii@zasenko.name>
---
 ui/vnc.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 92964dc..dea1414 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3715,11 +3715,6 @@ static int vnc_display_get_address(const char *addrstr,
         addr->type = SOCKET_ADDRESS_TYPE_UNIX;
         addr->u.q_unix.path = g_strdup(addrstr + 5);
 
-        if (websocket) {
-            error_setg(errp, "UNIX sockets not supported with websock");
-            goto cleanup;
-        }
-
         if (to) {
             error_setg(errp, "Port range not support with UNIX socket");
             goto cleanup;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Allow UNIX socket for VNC websocket
  2023-07-23 21:03 [PATCH] Allow UNIX socket for VNC websocket Sergii Zasenko
@ 2023-07-24  8:08 ` Marc-André Lureau
  2023-07-24  8:48   ` Daniel P. Berrangé
  2023-07-24  8:49 ` Daniel P. Berrangé
  1 sibling, 1 reply; 6+ messages in thread
From: Marc-André Lureau @ 2023-07-24  8:08 UTC (permalink / raw)
  To: Sergii Zasenko, Daniel P. Berrange; +Cc: qemu-devel

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

Hi

Daniel, in commit 275e0d616b ("ui: refactor code for populating
SocketAddress from vnc_display_open"), you said "This refactoring also
removes the restriction that prevents enabling websockets when the plain
VNC server is listening on a UNIX socket.". But you didn't remove the
condition. I suppose it was a left-over?


On Mon, Jul 24, 2023 at 1:59 AM Sergii Zasenko <sergii@zasenko.name> wrote:

> Signed-off-by: Sergii Zasenko <sergii@zasenko.name>
>

lgtm
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>



> ---
>  ui/vnc.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 92964dc..dea1414 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3715,11 +3715,6 @@ static int vnc_display_get_address(const char
> *addrstr,
>          addr->type = SOCKET_ADDRESS_TYPE_UNIX;
>          addr->u.q_unix.path = g_strdup(addrstr + 5);
>
> -        if (websocket) {
> -            error_setg(errp, "UNIX sockets not supported with websock");
> -            goto cleanup;
> -        }
> -
>          if (to) {
>              error_setg(errp, "Port range not support with UNIX socket");
>              goto cleanup;
> --
> 2.39.2
>
>
>

-- 
Marc-André Lureau

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Allow UNIX socket for VNC websocket
  2023-07-24  8:08 ` Marc-André Lureau
@ 2023-07-24  8:48   ` Daniel P. Berrangé
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel P. Berrangé @ 2023-07-24  8:48 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Sergii Zasenko, qemu-devel

On Mon, Jul 24, 2023 at 12:08:26PM +0400, Marc-André Lureau wrote:
> Hi
> 
> Daniel, in commit 275e0d616b ("ui: refactor code for populating
> SocketAddress from vnc_display_open"), you said "This refactoring also
> removes the restriction that prevents enabling websockets when the plain
> VNC server is listening on a UNIX socket.". But you didn't remove the
> condition. I suppose it was a left-over?

That commit was allowing the regular VNC port to be put on UNIX
socket, at the same time as WS was enabled, it wasn't trying to
put WS on a UNIX socket. Still I seee no reason to keep the
limitation.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Allow UNIX socket for VNC websocket
  2023-07-23 21:03 [PATCH] Allow UNIX socket for VNC websocket Sergii Zasenko
  2023-07-24  8:08 ` Marc-André Lureau
@ 2023-07-24  8:49 ` Daniel P. Berrangé
  2023-07-24 10:03   ` [PATCH] Allow UNIX socket option " Sergii Zasenko
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel P. Berrangé @ 2023-07-24  8:49 UTC (permalink / raw)
  To: Sergii Zasenko; +Cc: qemu-devel

On Mon, Jul 24, 2023 at 12:03:56AM +0300, Sergii Zasenko wrote:
> Signed-off-by: Sergii Zasenko <sergii@zasenko.name>
> ---
>  ui/vnc.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 92964dc..dea1414 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3715,11 +3715,6 @@ static int vnc_display_get_address(const char *addrstr,
>          addr->type = SOCKET_ADDRESS_TYPE_UNIX;
>          addr->u.q_unix.path = g_strdup(addrstr + 5);
>  
> -        if (websocket) {
> -            error_setg(errp, "UNIX sockets not supported with websock");
> -            goto cleanup;
> -        }
> -
>          if (to) {
>              error_setg(errp, "Port range not support with UNIX socket");
>              goto cleanup;

Missing docs update to qemu-options.hx to describe the permitted
syntax for the new feature.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] Allow UNIX socket option for VNC websocket
  2023-07-24  8:49 ` Daniel P. Berrangé
@ 2023-07-24 10:03   ` Sergii Zasenko
  2023-07-24 10:05     ` Marc-André Lureau
  0 siblings, 1 reply; 6+ messages in thread
From: Sergii Zasenko @ 2023-07-24 10:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sergii Zasenko

- Remove unix socket option limitation for VNC websocket
- Reflect websocket option changes in documentation

Signed-off-by: Sergii Zasenko <sergii@zasenko.name>
---
 qemu-options.hx | 4 ++++
 ui/vnc.c        | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 29b98c3..8cc910d 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2451,6 +2451,10 @@ SRST
         host. It is possible to control the websocket listen address
         independently, using the syntax ``websocket``\ =host:port.
 
+        Websocket could be allowed over UNIX domain socket, using the syntax
+        ``websocket``\ =unix:path, where path is the location of a unix socket
+        to listen for connections on.
+
         If no TLS credentials are provided, the websocket connection
         runs in unencrypted mode. If TLS credentials are provided, the
         websocket connection requires encrypted client connections.
diff --git a/ui/vnc.c b/ui/vnc.c
index 92964dc..dea1414 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3715,11 +3715,6 @@ static int vnc_display_get_address(const char *addrstr,
         addr->type = SOCKET_ADDRESS_TYPE_UNIX;
         addr->u.q_unix.path = g_strdup(addrstr + 5);
 
-        if (websocket) {
-            error_setg(errp, "UNIX sockets not supported with websock");
-            goto cleanup;
-        }
-
         if (to) {
             error_setg(errp, "Port range not support with UNIX socket");
             goto cleanup;
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Allow UNIX socket option for VNC websocket
  2023-07-24 10:03   ` [PATCH] Allow UNIX socket option " Sergii Zasenko
@ 2023-07-24 10:05     ` Marc-André Lureau
  0 siblings, 0 replies; 6+ messages in thread
From: Marc-André Lureau @ 2023-07-24 10:05 UTC (permalink / raw)
  To: Sergii Zasenko; +Cc: qemu-devel

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

On Mon, Jul 24, 2023 at 2:04 PM Sergii Zasenko <sergii@zasenko.name> wrote:

> - Remove unix socket option limitation for VNC websocket
> - Reflect websocket option changes in documentation
>
> Signed-off-by: Sergii Zasenko <sergii@zasenko.name>
>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  qemu-options.hx | 4 ++++
>  ui/vnc.c        | 5 -----
>  2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 29b98c3..8cc910d 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -2451,6 +2451,10 @@ SRST
>          host. It is possible to control the websocket listen address
>          independently, using the syntax ``websocket``\ =host:port.
>
> +        Websocket could be allowed over UNIX domain socket, using the
> syntax
> +        ``websocket``\ =unix:path, where path is the location of a unix
> socket
> +        to listen for connections on.
> +
>          If no TLS credentials are provided, the websocket connection
>          runs in unencrypted mode. If TLS credentials are provided, the
>          websocket connection requires encrypted client connections.
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 92964dc..dea1414 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -3715,11 +3715,6 @@ static int vnc_display_get_address(const char
> *addrstr,
>          addr->type = SOCKET_ADDRESS_TYPE_UNIX;
>          addr->u.q_unix.path = g_strdup(addrstr + 5);
>
> -        if (websocket) {
> -            error_setg(errp, "UNIX sockets not supported with websock");
> -            goto cleanup;
> -        }
> -
>          if (to) {
>              error_setg(errp, "Port range not support with UNIX socket");
>              goto cleanup;
> --
> 2.39.2
>
>
>

-- 
Marc-André Lureau

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-24 10:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-23 21:03 [PATCH] Allow UNIX socket for VNC websocket Sergii Zasenko
2023-07-24  8:08 ` Marc-André Lureau
2023-07-24  8:48   ` Daniel P. Berrangé
2023-07-24  8:49 ` Daniel P. Berrangé
2023-07-24 10:03   ` [PATCH] Allow UNIX socket option " Sergii Zasenko
2023-07-24 10:05     ` Marc-André Lureau

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).