[virt-tools-list] [PATCH virt-viewer] spice: fix connecting via ssh to a password-protected server

Daniel P. Berrange berrange at redhat.com
Thu Mar 1 14:10:25 UTC 2012


On Thu, Mar 01, 2012 at 03:08:19PM +0100, Marc-André Lureau wrote:
> spice_session_connect() will attempt to connect directly to the
> server, we need to continue calling spice_session_open_fd() for ssh
> tunnel to work.
> ---
>  configure.ac                    |    2 +-
>  src/virt-viewer-session-spice.c |    9 ++++++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 6cf01c3..e94924c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -17,7 +17,7 @@ GTK2_REQUIRED="2.18.0"
>  GTK3_REQUIRED="3.0"
>  GTK_VNC1_REQUIRED="0.3.8"
>  GTK_VNC2_REQUIRED="0.4.0"
> -SPICE_GTK_REQUIRED="0.9.11"
> +SPICE_GTK_REQUIRED="0.10.3"
>  
>  AC_PROG_CC
>  AM_PROG_CC_C_O
> diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> index eacb6e6..51ecebf 100644
> --- a/src/virt-viewer-session-spice.c
> +++ b/src/virt-viewer-session-spice.c
> @@ -316,8 +316,15 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
>          if (ret < 0) {
>              g_signal_emit_by_name(session, "session-cancelled");
>          } else {
> +            gboolean openfd;
> +
>              g_object_set(self->priv->session, "password", password, NULL);
> -            spice_session_connect(self->priv->session);
> +            g_object_get(self->priv->session, "client-sockets", &openfd, NULL);
> +
> +            if (openfd)
> +                spice_session_open_fd(self->priv->session, -1);
> +            else
> +                spice_session_connect(self->priv->session);
>          }
>          break;
>      default:

Ahhhh, of course - I hadn't noticed that with SPICE auth, you have to
effectively re-establish the connection, so I was looking at the wrong
code !

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list