diff mbox series

[v6,07/23] vl: simplify display_remote logic

Message ID 20231025190818.3278423-8-marcandre.lureau@redhat.com
State Handled Elsewhere
Headers show
Series Make Pixman an optional dependency | expand

Commit Message

Marc-André Lureau Oct. 25, 2023, 7:08 p.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Bump the display_remote variable when the -vnc option is parsed, just
like -spice.

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

Comments

Thomas Huth Oct. 26, 2023, 5:29 a.m. UTC | #1
On 25/10/2023 21.08, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Bump the display_remote variable when the -vnc option is parsed, just
> like -spice.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   system/vl.c | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/system/vl.c b/system/vl.c
> index de6df188da..b07805d476 100644
> --- a/system/vl.c
> +++ b/system/vl.c
> @@ -1401,11 +1401,6 @@ static void qemu_create_default_devices(void)
>   #endif
>       }
>   
> -#if defined(CONFIG_VNC)
> -    if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
> -        display_remote++;
> -    }
> -#endif
>       if (dpy.type == DISPLAY_TYPE_DEFAULT && !display_remote) {
>           if (!qemu_display_find_default(&dpy)) {
>               dpy.type = DISPLAY_TYPE_NONE;
> @@ -3350,6 +3345,7 @@ void qemu_init(int argc, char **argv)
>   #ifdef CONFIG_VNC
>               case QEMU_OPTION_vnc:
>                   vnc_parse(optarg);
> +                display_remote++;
>                   break;
>   #endif
>               case QEMU_OPTION_no_acpi:

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/system/vl.c b/system/vl.c
index de6df188da..b07805d476 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1401,11 +1401,6 @@  static void qemu_create_default_devices(void)
 #endif
     }
 
-#if defined(CONFIG_VNC)
-    if (!QTAILQ_EMPTY(&(qemu_find_opts("vnc")->head))) {
-        display_remote++;
-    }
-#endif
     if (dpy.type == DISPLAY_TYPE_DEFAULT && !display_remote) {
         if (!qemu_display_find_default(&dpy)) {
             dpy.type = DISPLAY_TYPE_NONE;
@@ -3350,6 +3345,7 @@  void qemu_init(int argc, char **argv)
 #ifdef CONFIG_VNC
             case QEMU_OPTION_vnc:
                 vnc_parse(optarg);
+                display_remote++;
                 break;
 #endif
             case QEMU_OPTION_no_acpi: