qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] ui/gtk: detach VCS for additional guest displays


From: Gerd Hoffmann
Subject: Re: [PATCH 1/2] ui/gtk: detach VCS for additional guest displays
Date: Fri, 10 Jun 2022 08:05:11 +0200

On Tue, May 31, 2022 at 01:23:26PM -0700, Dongwon Kim wrote:
> Detaching any addtional guest displays in case there are multiple
> displays assigned to the guest OS (e.g. max_outputs=n) so that
> all of them are visible upon lauching.
> 
> Cc: Daniel P. Berrangé <berrange@redhat.com>
> Cc: Markus Armbruster <armbru@redhat.com>
> Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
> ---
>  ui/gtk.c | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index c57c36749e..abfcf48547 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -2304,6 +2304,8 @@ static void gtk_display_init(DisplayState *ds, 
> DisplayOptions *opts)
>      GtkDisplayState *s = g_malloc0(sizeof(*s));
>      GdkDisplay *window_display;
>      GtkIconTheme *theme;
> +    int n_gfx_vcs = 0;
> +    int i;
>      char *dir;
>  
>      if (!gtkinit) {
> @@ -2374,7 +2376,14 @@ static void gtk_display_init(DisplayState *ds, 
> DisplayOptions *opts)
>      gtk_widget_set_sensitive(s->copy_item,
>                               vc && vc->type == GD_VC_VTE);
>  #endif
> -
> +    for (i = 0; i < s->nb_vcs; i++) {
> +        if (qemu_console_is_graphic(s->vc[i].gfx.dcl.con)) {

Accessing vc[i].gfx without checking vc[i].type beforehand is wrong.

Also note that graphical consoles are sorted to the head of the list.
n_gfx_vcs should not be needed because the primary gfx display has
index 0 no matter what.

take care,
  Gerd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]