[virt-tools-list] [PATCH virt-viewer] remote-viewer: Pass guri to remote_viewer_session_connected

Victor Toso victortoso at redhat.com
Wed Oct 25 09:44:54 UTC 2017


Hey,

Patch does not apply, I guess there are extra changes before this
patch

On Fri, Oct 20, 2017 at 03:10:53PM -0200, Eduardo Lima (Etrunko) wrote:
> When connecting to a VM via oVirt instance, the original uri can not be
> retrieved using virt_viewer_session_get_uri(). Consequently, it was
> never saved, even though the connection succeeds and the actual callback
> for "session-connected" signal, which saves the URI, is invoked.

Shouldn't we save the URI instead?

> To solve this problem, we always pass a copy of the guri as user-data
> parameter for the callback, and if the call to
> virt_viewer_session_get_uri() returns NULL, the parameter is used
> instead.
>
> Resolves: https://bugzilla.redhat.com/1459792
>
> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> ---
>  src/remote-viewer.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/remote-viewer.c b/src/remote-viewer.c
> index 7834dac..7366fa1 100644
> --- a/src/remote-viewer.c
> +++ b/src/remote-viewer.c
> @@ -1075,13 +1075,17 @@ remote_viewer_recent_add(gchar *uri, const gchar *mime_type)
>
>  static void
>  remote_viewer_session_connected(VirtViewerSession *session,
> -                                VirtViewerApp *self G_GNUC_UNUSED)
> +                                gchar *guri)
>  {
>      gchar *uri = virt_viewer_session_get_uri(session);
>      const gchar *mime = virt_viewer_session_mime_type(session);
>
> +    if (uri == NULL)
> +        uri = g_strdup(guri);
> +
>      remote_viewer_recent_add(uri, mime);
>      g_free(uri);
> +    g_free(guri);
>  }
>
>  static gboolean
> @@ -1169,7 +1173,7 @@ retry_dialog:
>          }
>
>          g_signal_connect(virt_viewer_app_get_session(app), "session-connected",
> -                         G_CALLBACK(remote_viewer_session_connected), app);
> +                         G_CALLBACK(remote_viewer_session_connected), g_strdup(guri));

On my master, this function call is on remote_viewer_initial_connect()
which does not have guri.

Seems that this was moved to remote_viewer_start() in your branch?

Cheers,
    Victor

>
>          virt_viewer_session_set_file(virt_viewer_app_get_session(app), vvfile);
>  #ifdef HAVE_OVIRT
> --
> 2.13.6
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20171025/ebb37cb3/attachment.sig>


More information about the virt-tools-list mailing list