[virt-tools-list] [virt-viewer][PATCH v3 1/2] virt-viewer-display-vnc: Set guest name when using VNC

Pavel Grunt pgrunt at redhat.com
Thu May 21 11:14:16 UTC 2015


On Mon, 2015-05-11 at 09:59 +0200, Fabiano Fidêncio wrote:
> On Wed, Apr 29, 2015 at 5:39 PM, Lukas Venhoda <lvenhoda at redhat.com> 
> wrote:
> > If it's not already set, set guest name field in virt-viewer-app 
> > when using VNC.
> > 
> > Wait for VNC to be initialized 
> > (virt_viewer_display_vnc_initialized()).
> > In this callback get field guest name from app and check whether it
> > was already set before (FE from libvirt).
> > If not, set the guest name to name provided by VNC from
> > vnc_display_get_name().
> > 
> > This fill fix issue in remote-viewer: Guest name is Unknown when 
> > using VNC.
> > ---
> > Changes since v2:
> >  - Changed char to gchar.
> > 
> > Changes since v1:
> >  - Added NULL checking for name returned from vnc_display_get_name.
> > ---
> >  src/virt-viewer-display-vnc.c | 14 ++++++++++++++
> >  1 file changed, 14 insertions(+)
> > 
> > diff --git a/src/virt-viewer-display-vnc.c b/src/virt-viewer
> > -display-vnc.c
> > index 6605b1b..5b57a32 100644
> > --- a/src/virt-viewer-display-vnc.c
> > +++ b/src/virt-viewer-display-vnc.c
> > @@ -116,9 +116,23 @@ static void
> >  virt_viewer_display_vnc_initialized(VncDisplay *vnc G_GNUC_UNUSED,
> >                                      VirtViewerDisplay *display)
> >  {
> > +    gchar *name = 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);
> > +    if (name == NULL || *name == '\0') {
> > +        const gchar * vnc_name = vnc_display_get_name(vnc);
> > +        if (vnc_name != NULL) {
> > +            g_object_set(app, "guest-name", vnc_name, NULL);
> > +        }
> > +    }
> > +
> >      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);
> >  }
> > 
> >  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
> 
> 
> ACK both patches!

Pushed as 772698a8a6e34c0b5051a3519f9284313426c1ca and
fc2add5827c359ced244c4e0a9cb36d24c24ee83

Pavel




More information about the virt-tools-list mailing list