xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>
Subject: [PATCH 5/6] libxl: vncviewer: unconditionally read listen port address and password
Date: Tue, 1 Feb 2011 18:25:01 +0000	[thread overview]
Message-ID: <1296584702-20138-6-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1296584702-20138-5-git-send-email-ian.jackson@eu.citrix.com>

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>
---
 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));
-    }
 
     if ( NULL == vnc_listen )
         vnc_listen = "localhost";
-- 
1.5.6.5

  reply	other threads:[~2011-02-01 18:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-01 18:24 [PATCH 0/6] Fix xl vncviewer Ian Jackson
2011-02-01 18:24 ` [PATCH 1/1] vnc, xen: write vnc address and password to xenstore Ian Jackson
2011-02-01 18:24   ` [PATCH 2/6] libxl: SECURITY: always honour request for vnc password Ian Jackson
2011-02-01 18:24     ` [PATCH 3/6] libxl: actually print an error when execve (in libxl__exec) fails Ian Jackson
2011-02-01 18:25       ` [PATCH 4/6] libxl: vncviewer: fix use-after-free Ian Jackson
2011-02-01 18:25         ` Ian Jackson [this message]
2011-02-01 18:25           ` [PATCH 6/6] libxl: vncviewer: make autopass work properly Ian Jackson
2011-02-03 12:39             ` Stefano Stabellini
2011-02-03 18:40               ` Ian Jackson
2011-02-04 11:15                 ` Stefano Stabellini
2011-02-04 14:45                   ` Ian Jackson
2011-02-04 14:51                     ` Stefano Stabellini
2011-02-03 12:39           ` [PATCH 5/6] libxl: vncviewer: unconditionally read listen port address and password Stefano Stabellini
2011-02-03 18:44             ` Ian Jackson
2011-02-03 12:38   ` [PATCH 1/1] vnc, xen: write vnc address and password to xenstore Stefano Stabellini
2011-02-03 18:42     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296584702-20138-6-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).