libxl: vncviewer: unconditionally read listen port address and password

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@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Ian Jackson committed 2011-02-04 18:47:20 +00:00
1 parent e887904db6
commit 2cc64e2e7c
1 file changed
+7 -11
+7 -11
View File
@@ -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));
}
if ( NULL == vnc_listen )
vnc_listen = "localhost";
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.