qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/3] Ui 20181001 patches
@ 2018-10-01 10:42 Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 1/3] sdl2: show console #0 unconditionally Gerd Hoffmann
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-10-01 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Gerd Hoffmann, Markus Armbruster

The following changes since commit 07f426c35eddd79388a23d11cb278600d7e3831d:

  Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180926' into staging (2018-09-28 18:56:09 +0100)

are available in the git repository at:

  git://git.kraxel.org/qemu tags/ui-20181001-pull-request

for you to fetch changes up to e8b1386ea1719525a1a92df03377764703fe8c64:

  gtk: add zoom-to-fit to gtk options. (2018-10-01 11:29:03 +0200)

----------------------------------------------------------------
ui: some small fixes/improvements.

----------------------------------------------------------------

Gerd Hoffmann (2):
  sdl2: show console #0 unconditionally
  gtk: add zoom-to-fit to gtk options.

Marc-André Lureau (1):
  vnc: call sasl_server_init() only when required

 ui/gtk.c     |  8 ++++++++
 ui/sdl2.c    |  3 ++-
 ui/vnc.c     | 15 ++++++++-------
 qapi/ui.json | 10 +++++++++-
 4 files changed, 27 insertions(+), 9 deletions(-)

-- 
2.9.3

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

* [Qemu-devel] [PULL 1/3] sdl2: show console #0 unconditionally
  2018-10-01 10:42 [Qemu-devel] [PULL 0/3] Ui 20181001 patches Gerd Hoffmann
@ 2018-10-01 10:42 ` Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 2/3] vnc: call sasl_server_init() only when required Gerd Hoffmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-10-01 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Gerd Hoffmann, Markus Armbruster

Otherwise sdl2 will show no window in case no graphical
display device is present.

Reproducer: qemu -nodefaults -display sdl -serial vc

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20180912114300.6976-1-kraxel@redhat.com
---
 ui/sdl2.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ui/sdl2.c b/ui/sdl2.c
index 0a9a18a964..2696b95c79 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -806,7 +806,8 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
     for (i = 0; i < sdl2_num_outputs; i++) {
         QemuConsole *con = qemu_console_lookup_by_index(i);
         assert(con != NULL);
-        if (!qemu_console_is_graphic(con)) {
+        if (!qemu_console_is_graphic(con) &&
+            qemu_console_get_index(con) != 0) {
             sdl2_console[i].hidden = true;
         }
         sdl2_console[i].idx = i;
-- 
2.9.3

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

* [Qemu-devel] [PULL 2/3] vnc: call sasl_server_init() only when required
  2018-10-01 10:42 [Qemu-devel] [PULL 0/3] Ui 20181001 patches Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 1/3] sdl2: show console #0 unconditionally Gerd Hoffmann
@ 2018-10-01 10:42 ` Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 3/3] gtk: add zoom-to-fit to gtk options Gerd Hoffmann
  2018-10-01 15:36 ` [Qemu-devel] [PULL 0/3] Ui 20181001 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-10-01 10:42 UTC (permalink / raw)
  To: qemu-devel
  Cc: Eric Blake, Gerd Hoffmann, Markus Armbruster,
	Marc-André Lureau

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

VNC server is calling sasl_server_init() during startup of QEMU, even
if SASL auth has not been enabled.

This may create undesirable warnings like "Could not find keytab file:
/etc/qemu/krb5.tab" when the user didn't configure SASL on host and
started VNC server.

Instead, only initialize SASL when needed. Note that HMP/QMP "change
vnc" calls vnc_display_open() again, which will initialize SASL if
needed.

Fix assignment in if condition, while touching this code.

Related to:
https://bugzilla.redhat.com/show_bug.cgi?id=1609327

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20180907063634.359-1-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 ui/vnc.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index 916a16d312..cf221c83cc 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3821,9 +3821,6 @@ void vnc_display_open(const char *id, Error **errp)
     bool reverse = false;
     const char *credid;
     bool sasl = false;
-#ifdef CONFIG_VNC_SASL
-    int saslErr;
-#endif
     int acl = 0;
     int lock_key_sync = 1;
     int key_delay_ms;
@@ -3963,10 +3960,14 @@ void vnc_display_open(const char *id, Error **errp)
     trace_vnc_auth_init(vd, 1, vd->ws_auth, vd->ws_subauth);
 
 #ifdef CONFIG_VNC_SASL
-    if ((saslErr = sasl_server_init(NULL, "qemu")) != SASL_OK) {
-        error_setg(errp, "Failed to initialize SASL auth: %s",
-                   sasl_errstring(saslErr, NULL, NULL));
-        goto fail;
+    if (sasl) {
+        int saslErr = sasl_server_init(NULL, "qemu");
+
+        if (saslErr != SASL_OK) {
+            error_setg(errp, "Failed to initialize SASL auth: %s",
+                       sasl_errstring(saslErr, NULL, NULL));
+            goto fail;
+        }
     }
 #endif
     vd->lock_key_sync = lock_key_sync;
-- 
2.9.3

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

* [Qemu-devel] [PULL 3/3] gtk: add zoom-to-fit to gtk options.
  2018-10-01 10:42 [Qemu-devel] [PULL 0/3] Ui 20181001 patches Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 1/3] sdl2: show console #0 unconditionally Gerd Hoffmann
  2018-10-01 10:42 ` [Qemu-devel] [PULL 2/3] vnc: call sasl_server_init() only when required Gerd Hoffmann
@ 2018-10-01 10:42 ` Gerd Hoffmann
  2018-10-01 15:36 ` [Qemu-devel] [PULL 0/3] Ui 20181001 patches Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Gerd Hoffmann @ 2018-10-01 10:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Eric Blake, Gerd Hoffmann, Markus Armbruster

This allows to set the option on the command line, i.e. "-display
gtk,zoom-to-fit={on,off}", overriding the default chosen by qemu.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20180827095620.26774-1-kraxel@redhat.com
---
 ui/gtk.c     |  8 ++++++++
 qapi/ui.json | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/ui/gtk.c b/ui/gtk.c
index 5cce6ed42d..3ddb5fe162 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2136,6 +2136,8 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
                               QemuConsole *con, int idx,
                               GSList *group, GtkWidget *view_menu)
 {
+    bool zoom_to_fit;
+
     vc->label = qemu_console_get_label(con);
     vc->s = s;
     vc->gfx.scale_x = 1.0;
@@ -2199,6 +2201,12 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
     group = gd_vc_menu_init(s, vc, idx, group, view_menu);
 
     if (dpy_ui_info_supported(vc->gfx.dcl.con)) {
+        zoom_to_fit = true;
+    }
+    if (s->opts->u.gtk.has_zoom_to_fit) {
+        zoom_to_fit = s->opts->u.gtk.zoom_to_fit;
+    }
+    if (zoom_to_fit) {
         gtk_menu_item_activate(GTK_MENU_ITEM(s->zoom_fit_item));
         s->free_scale = true;
     }
diff --git a/qapi/ui.json b/qapi/ui.json
index 4ca91bb45a..bf9e157d5a 100644
--- a/qapi/ui.json
+++ b/qapi/ui.json
@@ -1022,12 +1022,20 @@
 # GTK display options.
 #
 # @grab-on-hover: Grab keyboard input on mouse hover.
+# @zoom-to-fit: Zoom guest display to fit into the host window.  When
+#               turned off the host window will be resized instead.
+#               In case the display device can notify the guest on
+#               window resizes (virtio-gpu) this will default to "on",
+#               assuming the guest will resize the display to match
+#               the window size then.  Otherwise it defaults to "off".
+#               Since 3.1
 #
 # Since: 2.12
 #
 ##
 { 'struct'  : 'DisplayGTK',
-  'data'    : { '*grab-on-hover' : 'bool' } }
+  'data'    : { '*grab-on-hover' : 'bool',
+                '*zoom-to-fit'   : 'bool'  } }
 
  ##
  # @DisplayGLMode:
-- 
2.9.3

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

* Re: [Qemu-devel] [PULL 0/3] Ui 20181001 patches
  2018-10-01 10:42 [Qemu-devel] [PULL 0/3] Ui 20181001 patches Gerd Hoffmann
                   ` (2 preceding siblings ...)
  2018-10-01 10:42 ` [Qemu-devel] [PULL 3/3] gtk: add zoom-to-fit to gtk options Gerd Hoffmann
@ 2018-10-01 15:36 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2018-10-01 15:36 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: QEMU Developers, Markus Armbruster

On 1 October 2018 at 11:42, Gerd Hoffmann <kraxel@redhat.com> wrote:
> The following changes since commit 07f426c35eddd79388a23d11cb278600d7e3831d:
>
>   Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20180926' into staging (2018-09-28 18:56:09 +0100)
>
> are available in the git repository at:
>
>   git://git.kraxel.org/qemu tags/ui-20181001-pull-request
>
> for you to fetch changes up to e8b1386ea1719525a1a92df03377764703fe8c64:
>
>   gtk: add zoom-to-fit to gtk options. (2018-10-01 11:29:03 +0200)
>
> ----------------------------------------------------------------
> ui: some small fixes/improvements.
>
Applied, thanks.

-- PMM

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

end of thread, other threads:[~2018-10-01 15:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-01 10:42 [Qemu-devel] [PULL 0/3] Ui 20181001 patches Gerd Hoffmann
2018-10-01 10:42 ` [Qemu-devel] [PULL 1/3] sdl2: show console #0 unconditionally Gerd Hoffmann
2018-10-01 10:42 ` [Qemu-devel] [PULL 2/3] vnc: call sasl_server_init() only when required Gerd Hoffmann
2018-10-01 10:42 ` [Qemu-devel] [PULL 3/3] gtk: add zoom-to-fit to gtk options Gerd Hoffmann
2018-10-01 15:36 ` [Qemu-devel] [PULL 0/3] Ui 20181001 patches Peter Maydell

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