[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 5/6] libxl: vncviewer: unconditionally read listen port address and password



On Tue, 1 Feb 2011, Ian Jackson wrote:
> The /local/domain/DOMID/device/vfb/0/backend path is irrelevant.
> libxl does not create it, so the branch would never be taken.
> 
> Instead, simply read the target paths of interest.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
> ---
>  tools/libxl/libxl.c |   18 +++++++-----------
>  1 files changed, 7 insertions(+), 11 deletions(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 374e05e..b386a2a 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -791,7 +791,7 @@ int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t 
> domid_vm)
>  int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t domid, int autopass)
>  {
>      libxl__gc gc = LIBXL_INIT_GC(ctx);
> -    const char *vnc_port, *vfb_back;
> +    const char *vnc_port;
>      const char *vnc_listen = NULL, *vnc_pass = NULL;
>      int port = 0, autopass_fd = -1;
>      char *vnc_bin, *args[] = {
> @@ -807,18 +807,14 @@ int libxl_vncviewer_exec(libxl_ctx *ctx, uint32_t 
> domid, int autopass)
>      if ( vnc_port )
>          port = atoi(vnc_port) - 5900;
>  
> -    vfb_back = libxl__xs_read(&gc, XBT_NULL,
> -                            libxl__sprintf(&gc,
> -                            "/local/domain/%d/device/vfb/0/backend", domid));
> -    if ( vfb_back ) {
> -        vnc_listen = libxl__xs_read(&gc, XBT_NULL,
> -                            libxl__sprintf(&gc,
> +    vnc_listen = libxl__xs_read(&gc, XBT_NULL,
> +                                libxl__sprintf(&gc,
>                              "/local/domain/%d/console/vnc-listen", domid));
> -        if ( autopass )
> -            vnc_pass = libxl__xs_read(&gc, XBT_NULL,
> -                            libxl__sprintf(&gc,
> +
> +    if ( autopass )
> +        vnc_pass = libxl__xs_read(&gc, XBT_NULL,
> +                                  libxl__sprintf(&gc,
>                              "/local/domain/%d/console/vnc-pass", domid));
> -    }
>  

these changes don't follow the coding style (but even the original code
does not).

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.