Hello community, here is the log from the commit of package virt-viewer for openSUSE:Factory checked in at 2012-12-05 14:10:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/virt-viewer (Old) and /work/SRC/openSUSE:Factory/.virt-viewer.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "virt-viewer", Maintainer is "[email protected]" Changes: -------- --- /work/SRC/openSUSE:Factory/virt-viewer/virt-viewer.changes 2012-10-07 20:08:04.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.virt-viewer.new/virt-viewer.changes 2012-12-05 14:10:15.000000000 +0100 @@ -1,0 +2,10 @@ +Mon Nov 12 17:24:52 MST 2012 - [email protected] + +- Upstream bug fixes + virtview-git-ipv6-check.patch + virtview-git-resize-window.patch + virtview-git-spice-rounding.patch + virtview-git-spice-resize-window.patch + virtview-git-ssh-localhost-connect.patch + +------------------------------------------------------------------- New: ---- virtview-git-ipv6-check.patch virtview-git-resize-window.patch virtview-git-spice-resize-window.patch virtview-git-spice-rounding.patch virtview-git-ssh-localhost-connect.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ virt-viewer.spec ++++++ --- /var/tmp/diff_new_pack.L8bvr7/_old 2012-12-05 14:10:15.000000000 +0100 +++ /var/tmp/diff_new_pack.L8bvr7/_new 2012-12-05 14:10:15.000000000 +0100 @@ -23,6 +23,11 @@ Release: 0 Url: http://www.virt-manager.org Source0: virt-viewer-0.5.4.tar.gz +Patch0: virtview-git-ipv6-check.patch +Patch1: virtview-git-resize-window.patch +Patch2: virtview-git-spice-rounding.patch +Patch3: virtview-git-spice-resize-window.patch +Patch4: virtview-git-ssh-localhost-connect.patch Patch20: netcat.diff Patch21: windows-keycombo.patch Patch22: netware-keycombo.patch @@ -58,6 +63,11 @@ %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 %patch20 -p1 %patch21 -p1 %patch22 -p1 ++++++ netware-keycombo.patch ++++++ --- /var/tmp/diff_new_pack.L8bvr7/_old 2012-12-05 14:10:15.000000000 +0100 +++ /var/tmp/diff_new_pack.L8bvr7/_new 2012-12-05 14:10:15.000000000 +0100 @@ -2,7 +2,7 @@ =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-window.c +++ virt-viewer-0.5.4/src/virt-viewer-window.c -@@ -538,7 +538,7 @@ virt_viewer_window_enter_fullscreen(Virt +@@ -539,7 +539,7 @@ virt_viewer_window_enter_fullscreen(Virt #endif } @@ -11,7 +11,7 @@ struct keyComboDef { guint keys[MAX_KEY_COMBO]; guint nkeys; -@@ -548,7 +548,16 @@ struct keyComboDef { +@@ -549,7 +549,16 @@ struct keyComboDef { static const struct keyComboDef keyCombos[] = { { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"}, { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"}, @@ -29,7 +29,7 @@ { {}, 0, "" }, { { GDK_Control_L, GDK_Alt_L, GDK_F1 }, 3, "Ctrl+Alt+F_1"}, { { GDK_Control_L, GDK_Alt_L, GDK_F2 }, 3, "Ctrl+Alt+F_2"}, -@@ -559,7 +568,7 @@ static const struct keyComboDef keyCombo +@@ -560,7 +569,7 @@ static const struct keyComboDef keyCombo { { GDK_Control_L, GDK_Alt_L, GDK_F7 }, 3, "Ctrl+Alt+F_7"}, { { GDK_Control_L, GDK_Alt_L, GDK_F8 }, 3, "Ctrl+Alt+F_8"}, { { GDK_Control_L, GDK_Alt_L, GDK_F9 }, 3, "Ctrl+Alt+F_9"}, ++++++ report-error.patch ++++++ --- /var/tmp/diff_new_pack.L8bvr7/_old 2012-12-05 14:10:15.000000000 +0100 +++ /var/tmp/diff_new_pack.L8bvr7/_new 2012-12-05 14:10:15.000000000 +0100 @@ -2,7 +2,7 @@ =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer.c +++ virt-viewer-0.5.4/src/virt-viewer.c -@@ -482,6 +482,7 @@ virt_viewer_initial_connect(VirtViewerAp +@@ -509,6 +509,7 @@ virt_viewer_initial_connect(VirtViewerAp } else { virt_viewer_app_simple_message_dialog(app, _("Cannot find guest domain %s"), priv->domkey); ++++++ virtview-git-ipv6-check.patch ++++++ Subject: Fix check for IPv6 any address From: Daniel P. Berrange [email protected] Tue Oct 9 17:52:23 2012 +0100 Date: Wed Oct 10 16:28:38 2012 +0100: Git: c4bfbe104f507236e2f98d6d4aa5966b0b6857bc The string '::' is just one of many possible ways to express the IPv6 "any" address. Others include '::0', '0:0:0:0:0:0:0:0', '0::0' and more. Instead of trying to do strcmp, actually try parsing the address with GInetAddress and then simply use an accessor to check what type it is Signed-off-by: Daniel P. Berrange <[email protected]> Index: virt-viewer-0.5.4/src/virt-viewer.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer.c +++ virt-viewer-0.5.4/src/virt-viewer.c @@ -282,6 +282,27 @@ virt_viewer_extract_xpath_string(const g return port; } + +static gboolean +virt_viewer_replace_host(const gchar *host) +{ + GInetAddress *addr; + gboolean ret; + + if (!host) + return TRUE; + + addr = g_inet_address_new_from_string(host); + + if (!addr) /* Parsing error means it was probably a hostname */ + return FALSE; + + ret = g_inet_address_get_is_any(addr); + g_object_unref(addr); + + return ret; +} + static gboolean virt_viewer_extract_connect_info(VirtViewer *self, virDomainPtr dom) @@ -351,9 +372,7 @@ virt_viewer_extract_connect_info(VirtVie * from a remote host. Instead we fallback to the hostname used in * the libvirt URI. This isn't perfect but it is better than nothing */ - if (!ghost || - (strcmp(ghost, "0.0.0.0") == 0 || - strcmp(ghost, "::") == 0)) { + if (virt_viewer_replace_host(ghost)) { DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'", ghost ? ghost : "", host); g_free(ghost); ++++++ virtview-git-resize-window.patch ++++++ Subject: Do not resize window to minimum when toggling auto-resize From: Marc-André Lureau [email protected] Tue Oct 16 20:34:01 2012 +0200 Date: Tue Oct 16 20:41:47 2012 +0200: Git: 143bc8a33f8b6b522dc96a3cabfa46deedb00bcc The virt_viewer_display_idle() will queue a resize event that will result in display size requisition of 50x50. If we later resize the window to 1x1 in virt_viewer_window_resize() we end up with a tiny window. It is legitimate not to force that 1x1 window resize when toggling the option. After the rest of the logic in virt_viewer_window_resize(), if the remote desktop ends up being resize, that will trigger another virt_viewer_set_desktop_size() and finally change the window size appropriately. https://bugzilla.redhat.com/show_bug.cgi?id=856610 Index: virt-viewer-0.5.4/src/virt-viewer-window.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-window.c +++ virt-viewer-0.5.4/src/virt-viewer-window.c @@ -61,7 +61,7 @@ void virt_viewer_window_menu_view_releas /* Internal methods */ static void virt_viewer_window_enable_modifiers(VirtViewerWindow *self); static void virt_viewer_window_disable_modifiers(VirtViewerWindow *self); -static void virt_viewer_window_resize(VirtViewerWindow *self); +static void virt_viewer_window_resize(VirtViewerWindow *self, gboolean keep_win_size); static void virt_viewer_window_toolbar_setup(VirtViewerWindow *self); static GtkMenu* virt_viewer_window_get_keycombo_menu(VirtViewerWindow *self); @@ -346,7 +346,7 @@ virt_viewer_window_desktop_resize(VirtVi self->priv->desktop_resize_pending = TRUE; return; } - virt_viewer_window_resize(self); + virt_viewer_window_resize(self, FALSE); } @@ -403,7 +403,7 @@ virt_viewer_window_menu_view_zoom_reset( * scale down to fit, maintaining aspect ratio */ static void -virt_viewer_window_resize(VirtViewerWindow *self) +virt_viewer_window_resize(VirtViewerWindow *self, gboolean keep_win_size) { GdkRectangle fullscreen; GdkScreen *screen; @@ -423,7 +423,8 @@ virt_viewer_window_resize(VirtViewerWind return; } - gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); + if (!keep_win_size) + gtk_window_resize(GTK_WINDOW(priv->window), 1, 1); virt_viewer_display_get_desktop_size(VIRT_VIEWER_DISPLAY(priv->display), &desktopWidth, &desktopHeight); @@ -741,7 +742,7 @@ virt_viewer_window_menu_view_resize(GtkW if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(menu))) { priv->auto_resize = TRUE; - virt_viewer_window_resize(self); + virt_viewer_window_resize(self, TRUE); } else { priv->auto_resize = FALSE; } @@ -1071,7 +1072,7 @@ virt_viewer_window_show(VirtViewerWindow virt_viewer_display_set_enabled(self->priv->display, TRUE); if (self->priv->desktop_resize_pending) { - virt_viewer_window_resize(self); + virt_viewer_window_resize(self, FALSE); self->priv->desktop_resize_pending = FALSE; } } ++++++ virtview-git-spice-resize-window.patch ++++++ Subject: spice: only autoresize once with screen size in fullscreen From: Marc-André Lureau [email protected] Thu Oct 18 00:44:36 2012 +0200 Date: Thu Oct 18 00:44:36 2012 +0200: Git: 3bb6f5ec805ecfe78eba6d4d98e3ffcab195273a It's currently not possible to configure guest with higher resolution than native, as it will switch back to native, since the gtk widget allocation will always end up being the size of the screen. We special-case fullscreen mode, and only resize when entering fullscreen. Furthermore, it avoids sending extra unnecessary resize events to the guest whenever gtk+ call size allocate in various stages, with different values. https://bugzilla.redhat.com/show_bug.cgi?id=864929 Index: virt-viewer-0.5.4/src/virt-viewer-app.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-app.c +++ virt-viewer-0.5.4/src/virt-viewer-app.c @@ -1576,6 +1576,14 @@ static void fullscreen_cb(gpointer key, virt_viewer_window_leave_fullscreen(vwin); } +gboolean +virt_viewer_app_get_fullscreen(VirtViewerApp *self) +{ + g_return_val_if_fail(VIRT_VIEWER_IS_APP(self), FALSE); + + return self->priv->fullscreen; +} + static void virt_viewer_app_set_fullscreen(VirtViewerApp *self, gboolean fullscreen) { Index: virt-viewer-0.5.4/src/virt-viewer-app.h =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-app.h +++ virt-viewer-0.5.4/src/virt-viewer-app.h @@ -93,6 +93,7 @@ void virt_viewer_app_show_display(VirtVi GHashTable* virt_viewer_app_get_windows(VirtViewerApp *self); gboolean virt_viewer_app_get_enable_accel(VirtViewerApp *self); VirtViewerSession* virt_viewer_app_get_session(VirtViewerApp *self); +gboolean virt_viewer_app_get_fullscreen(VirtViewerApp *app); G_END_DECLS Index: virt-viewer-0.5.4/src/virt-viewer-display-spice.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-display-spice.c +++ virt-viewer-0.5.4/src/virt-viewer-display-spice.c @@ -38,6 +38,13 @@ G_DEFINE_TYPE (VirtViewerDisplaySpice, v struct _VirtViewerDisplaySpicePrivate { SpiceChannel *channel; /* weak reference */ SpiceDisplay *display; + int auto_resize; +}; + +enum { + AUTO_RESIZE_ALWAYS, + AUTO_RESIZE_FULLSCREEN, + AUTO_RESIZE_NEVER, }; #define VIRT_VIEWER_DISPLAY_SPICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE((o), VIRT_VIEWER_TYPE_DISPLAY_SPICE, VirtViewerDisplaySpicePrivate)) @@ -189,6 +196,12 @@ virt_viewer_display_spice_size_allocate( if (virt_viewer_display_get_show_hint(VIRT_VIEWER_DISPLAY(self)) & VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED) return; + if (self->priv->auto_resize == AUTO_RESIZE_FULLSCREEN) { + GdkScreen *screen = gtk_widget_get_screen(GTK_WIDGET(self)); + dw = gdk_screen_get_width(screen); + dh = gdk_screen_get_height(screen); + } + if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) { zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self)); @@ -198,8 +211,11 @@ virt_viewer_display_spice_size_allocate( g_object_get(self, "nth-display", &nth, NULL); - spice_main_set_display(get_main(VIRT_VIEWER_DISPLAY(self)), - nth, 0, 0, dw, dh); + if (self->priv->auto_resize != AUTO_RESIZE_NEVER) + spice_main_set_display(get_main(VIRT_VIEWER_DISPLAY(self)), + nth, 0, 0, dw, dh); + if (self->priv->auto_resize == AUTO_RESIZE_FULLSCREEN) + self->priv->auto_resize = AUTO_RESIZE_NEVER; } static void @@ -216,6 +232,15 @@ enable_accel_changed(VirtViewerApp *app, } } +static void +fullscreen_changed(VirtViewerApp *app, + GParamSpec *pspec G_GNUC_UNUSED, + VirtViewerDisplaySpice *self) +{ + self->priv->auto_resize = virt_viewer_app_get_fullscreen(app) ? + AUTO_RESIZE_FULLSCREEN : AUTO_RESIZE_ALWAYS; +} + GtkWidget * virt_viewer_display_spice_new(VirtViewerSessionSpice *session, SpiceChannel *channel, @@ -268,6 +293,8 @@ virt_viewer_display_spice_new(VirtViewer app = virt_viewer_session_get_app(VIRT_VIEWER_SESSION(session)); virt_viewer_signal_connect_object(app, "notify::enable-accel", G_CALLBACK(enable_accel_changed), self, 0); + virt_viewer_signal_connect_object(app, "notify::fullscreen", + G_CALLBACK(fullscreen_changed), self, 0); enable_accel_changed(app, NULL, self); return GTK_WIDGET(self); ++++++ virtview-git-spice-rounding.patch ++++++ Subject: spice: avoid rounding issues when scaling up display From: Marc-André Lureau [email protected] Wed Oct 17 16:47:55 2012 +0200 Date: Wed Oct 17 16:50:14 2012 +0200: Git: 435a542de205e4bf247b687b83b0742871204ea5 Fix some unwanted guest resize due to rounding issues (at least when scaling up) We may want to save the original remote desktop size, instead of always checking widget requisition. That way zooming shouldn't resize guest at all, but it seems tricky to handle that special case vs user window resize that should trigger guest resize. https://bugzilla.redhat.com/show_bug.cgi?id=856678 Index: virt-viewer-0.5.4/src/virt-viewer-display-spice.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-display-spice.c +++ virt-viewer-0.5.4/src/virt-viewer-display-spice.c @@ -24,6 +24,7 @@ #include <config.h> +#include <math.h> #include <spice-audio.h> #include <glib/gi18n.h> @@ -191,8 +192,8 @@ virt_viewer_display_spice_size_allocate( if (virt_viewer_display_get_zoom(VIRT_VIEWER_DISPLAY(self))) { zoom = virt_viewer_display_get_zoom_level(VIRT_VIEWER_DISPLAY(self)); - dw /= ((double)zoom / 100.0); - dh /= ((double)zoom / 100.0); + dw = round(dw * 100 / zoom); + dh = round(dh * 100 / zoom); } g_object_get(self, "nth-display", &nth, NULL); Index: virt-viewer-0.5.4/src/virt-viewer-display.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-display.c +++ virt-viewer-0.5.4/src/virt-viewer-display.c @@ -354,8 +354,8 @@ virt_viewer_display_size_request(GtkWidg if (priv->dirty) { if (priv->zoom) { - requisition->width += priv->desktopWidth * priv->zoom_level / 100; - requisition->height += priv->desktopHeight * priv->zoom_level / 100; + requisition->width += round(priv->desktopWidth * priv->zoom_level / 100.0); + requisition->height += round(priv->desktopHeight * priv->zoom_level / 100.0); } else { requisition->width += priv->desktopWidth; requisition->height += priv->desktopHeight; ++++++ virtview-git-ssh-localhost-connect.patch ++++++ Subject: Connect to localhost for display when transport is ssh From: Dave Allan [email protected] Thu Nov 8 17:44:01 2012 +0100 Date: Thu Nov 8 17:44:18 2012 +0100: Git: 74b1b62510d93903dbabdb95262f4ab4cd718520 When connecting to a VM that does not have a 'listen' tag in its graphcs element, we have to guess where to try to connect to the VM's display. The current default is the host specified in the connection URI which is correct for most transports, however, the SSH transport makes the display connection from the remote end, so in that case, attempt to connect to localhost. Signed-off-by: Daniel P. Berrange <[email protected]> Index: virt-viewer-0.5.4/src/virt-viewer.c =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer.c +++ virt-viewer-0.5.4/src/virt-viewer.c @@ -370,13 +370,21 @@ virt_viewer_extract_connect_info(VirtVie /* If the XML listen attribute shows a wildcard address, we need to * throw that away since you obviously can't 'connect(2)' to that * from a remote host. Instead we fallback to the hostname used in - * the libvirt URI. This isn't perfect but it is better than nothing + * the libvirt URI. This isn't perfect but it is better than nothing. + * If the transport is SSH, fallback to localhost as the connection + * will be made from the remote end of the ssh connection. */ if (virt_viewer_replace_host(ghost)) { + gchar *replacement_host = NULL; + if (g_str_equal(transport, "ssh")) { + replacement_host = g_strdup("localhost"); + } else { + replacement_host = g_strdup(host); + } DEBUG_LOG("Guest graphics listen '%s' is NULL or a wildcard, replacing with '%s'", - ghost ? ghost : "", host); + ghost ? ghost : "", replacement_host); g_free(ghost); - ghost = g_strdup(host); + ghost = replacement_host; } virt_viewer_app_set_connect_info(app, host, ghost, gport, gtlsport,transport, unixsock, user, port, NULL); ++++++ windows-keycombo.patch ++++++ --- /var/tmp/diff_new_pack.L8bvr7/_old 2012-12-05 14:10:15.000000000 +0100 +++ /var/tmp/diff_new_pack.L8bvr7/_new 2012-12-05 14:10:15.000000000 +0100 @@ -2,7 +2,7 @@ =================================================================== --- virt-viewer-0.5.4.orig/src/virt-viewer-window.c +++ virt-viewer-0.5.4/src/virt-viewer-window.c -@@ -548,6 +548,7 @@ struct keyComboDef { +@@ -549,6 +549,7 @@ struct keyComboDef { static const struct keyComboDef keyCombos[] = { { { GDK_Control_L, GDK_Alt_L, GDK_Delete }, 3, "Ctrl+Alt+_Del"}, { { GDK_Control_L, GDK_Alt_L, GDK_BackSpace }, 3, "Ctrl+Alt+_Backspace"}, -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
