[virt-tools-list] [virt-viewer][PATCH 2/2] virt-viewer-display-vnc: Set uuid when using VNC

Victor Toso victortoso at redhat.com
Wed Apr 29 12:48:58 UTC 2015


Hi,

On Wed, Apr 29, 2015 at 02:39:51PM +0200, Lukas Venhoda wrote:
> Notify user, that VNC does not provide uuid.
> 
> Set uuid to string "VNC does not provide guid".
> This is more informative then just plain "Unknown".
> User will now know WHY the GUID is unknown, when using remote-viewer.
> ---
>  src/virt-viewer-display-vnc.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-display-vnc.c b/src/virt-viewer-display-vnc.c
> index 9121e5f..4d6443b 100644
> --- a/src/virt-viewer-display-vnc.c
> +++ b/src/virt-viewer-display-vnc.c
> @@ -117,19 +117,24 @@ virt_viewer_display_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED,
>                                      VirtViewerDisplay *display)
>  {
>      char *name = NULL;
> +    char *uuid = NULL;
>      VirtViewerSession *session = virt_viewer_display_get_session(display);
>      VirtViewerApp *app = virt_viewer_session_get_app(session);
> 
> -    g_object_get(app, "guest-name", &name, NULL);
> +    g_object_get(app, "guest-name", &name, "uuid", &uuid, NULL);
>      if (name == NULL || *name == '\0') {
>          g_object_set(app, "guest-name", vnc_display_get_name(vnc), NULL);
>      }
> +    if (uuid == NULL || *uuid == '\0') {
> +        g_object_set(app, "uuid", g_strdup(_("VNC does not provide GUID")), NULL);
> +    }

You are leaking the uuid here
> 
>      virt_viewer_display_set_show_hint(display,
>                                        VIRT_VIEWER_DISPLAY_SHOW_HINT_READY, TRUE);
>      g_signal_emit_by_name(display, "display-desktop-resize");
> 
>      g_free(name);
> +    g_free(uuid);
>  }
> 
>  static void
> --
> 2.3.6
> 
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list




More information about the virt-tools-list mailing list