[virt-tools-list] [PATCH virt-viewer 2/2] Don't wait for reconnect when user cancels auth

Pavel Grunt pgrunt at redhat.com
Thu Jun 18 06:23:26 UTC 2015


Hi Jonathon, 

On Wed, 2015-06-17 at 17:11 -0500, Jonathon Jongsma wrote:
> When starting remote-viewer with the --reconnect switch to a guest that
When starting virt-viewer ...
> has a spice password, if the user cancels the authentication dialog
> (e.g. pressing 'Esc'), the window will display "Waiting for guest domain
> to restart".  Obviously, the domain will never restart because it's
> already running.
> 
> After this fix, the application will simply exit when the user cancels
> authentication, even if the --reconnect switch is used.
VNC guests will still have the problem, because the "session-cancelled" signal
is not emitted when authentication is cancelled. I think it should be solved
before applying this patch.

The patch itself looks ok to me

Pavel
> ---
>  src/virt-viewer-app.c | 5 +++++
>  src/virt-viewer-app.h | 1 +
>  src/virt-viewer.c     | 2 +-
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 2bf74f7..f9b491c 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -2579,6 +2579,11 @@ virt_viewer_app_get_option_group(void)
>      return group;
>  }
>  
> +gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self)
> +{
> +    return self->priv->cancelled;
> +}
> +
>  /*
>   * Local variables:
>   *  c-indent-level: 4
> diff --git a/src/virt-viewer-app.h b/src/virt-viewer-app.h
> index f53fa73..bbbc9b4 100644
> --- a/src/virt-viewer-app.h
> +++ b/src/virt-viewer-app.h
> @@ -102,6 +102,7 @@ gint 
> virt_viewer_app_get_initial_monitor_for_display(VirtViewerApp* self, gint d
>  void virt_viewer_app_set_enable_accel(VirtViewerApp *app, gboolean enable);
>  void virt_viewer_app_show_preferences(VirtViewerApp *app, GtkWidget *parent);
>  void virt_viewer_app_set_menus_sensitive(VirtViewerApp *self, gboolean 
> sensitive);
> +gboolean virt_viewer_app_get_session_cancelled(VirtViewerApp *self);
>  
>  G_END_DECLS
>  
> diff --git a/src/virt-viewer.c b/src/virt-viewer.c
> index 9c3ccc9..637b9e4 100644
> --- a/src/virt-viewer.c
> +++ b/src/virt-viewer.c
> @@ -161,7 +161,7 @@ virt_viewer_deactivated(VirtViewerApp *app, gboolean 
> connect_error)
>          priv->dom = NULL;
>      }
>  
> -    if (priv->reconnect) {
> +    if (priv->reconnect && !virt_viewer_app_get_session_cancelled(app)) {
>          if (priv->domain_event < 0) {
>              g_debug("No domain events, falling back to polling");
>              virt_viewer_start_reconnect_poll(self);




More information about the virt-tools-list mailing list