[PATCH] vl: add missing display_remote++

marcandre.lureau@redhat.com posted 1 patch 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231117141735.1511211-1-marcandre.lureau@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>
system/vl.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] vl: add missing display_remote++
Posted by marcandre.lureau@redhat.com 1 year ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

We should also consider -display vnc= as setting up a remote display,
and not attempt to add another default one.

The display_remote++ in qemu_setup_display() isn't necessary at this
point, but is there for completeness and further usages of the variable.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 system/vl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/system/vl.c b/system/vl.c
index 5af7ced2a1..f95ae77b5a 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1110,6 +1110,7 @@ static void parse_display(const char *p)
          */
         if (*opts == '=') {
             vnc_parse(opts + 1);
+            display_remote++;
         } else {
             error_report("VNC requires a display argument vnc=<display>");
             exit(1);
@@ -1359,6 +1360,7 @@ static void qemu_setup_display(void)
             dpy.type = DISPLAY_TYPE_NONE;
 #if defined(CONFIG_VNC)
             vnc_parse("localhost:0,to=99,id=default");
+            display_remote++;
 #endif
         }
     }
-- 
2.41.0


Re: [PATCH] vl: add missing display_remote++
Posted by Marc-André Lureau 1 year ago
Hi

On Fri, Nov 17, 2023 at 6:18 PM <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> We should also consider -display vnc= as setting up a remote display,
> and not attempt to add another default one.
>
> The display_remote++ in qemu_setup_display() isn't necessary at this
> point, but is there for completeness and further usages of the variable.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

It turns out this fixes a regression:
https://gitlab.com/qemu-project/qemu/-/issues/1988

Fixes: 484629fc81 ("vl: simplify display_remote logic ")

> ---
>  system/vl.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/system/vl.c b/system/vl.c
> index 5af7ced2a1..f95ae77b5a 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -1110,6 +1110,7 @@ static void parse_display(const char *p)
>           */
>          if (*opts == '=') {
>              vnc_parse(opts + 1);
> +            display_remote++;
>          } else {
>              error_report("VNC requires a display argument vnc=<display>");
>              exit(1);
> @@ -1359,6 +1360,7 @@ static void qemu_setup_display(void)
>              dpy.type = DISPLAY_TYPE_NONE;
>  #if defined(CONFIG_VNC)
>              vnc_parse("localhost:0,to=99,id=default");
> +            display_remote++;
>  #endif
>          }
>      }
> --
> 2.41.0
>
>


-- 
Marc-André Lureau