xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: ZhouPeng <zpengxen@gmail.com>
To: "ian.jackson" <Ian.Jackson@eu.citrix.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "Xen-Devel (E-mail)" <xen-devel@lists.xensource.com>
Subject: [PATCH] tools/libxl: prepare vnc options for dm_args in libxl__build_device_model_args_new
Date: Wed, 20 Apr 2011 14:30:36 +0800	[thread overview]
Message-ID: <BANLkTimAoF-wuMrL4Zunjzy7QRV_xv_3ZA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2075 bytes --]

This pacth clean up vnc options preparing code for xen-upstream-qemu.
Add password option which allows you to use vncpasswd auth by xl.


Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn>

tools/libxl: prepare vnc options for dm_args in
libxl__build_device_model_args_new

diff -r 569abaf2cc12 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Apr 19 13:17:14 2011 +0800
+++ b/tools/libxl/libxl_dm.c	Wed Apr 20 13:47:42 2011 +0800
@@ -208,11 +208,7 @@ static char ** libxl__build_device_model
     if (info->vnc || info->vncdisplay || info->vnclisten || info->vncunused) {
         int display = 0;
         const char *listen = "127.0.0.1";
-
-        if (info->vncpasswd && info->vncpasswd[0]) {
-            assert(!"missing code for supplying vnc password to qemu");
-        }
-        flexarray_append(dm_args, "-vnc");
+        char *vncoptions = NULL;

         if (info->vncdisplay) {
             display = info->vncdisplay;
@@ -224,13 +220,17 @@ static char ** libxl__build_device_model
         }

         if (strchr(listen, ':') != NULL)
-            flexarray_append(dm_args,
-                    libxl__sprintf(gc, "%s%s", listen,
-                        info->vncunused ? ",to=99" : ""));
+            vncoptions = libxl__sprintf(gc,
+                             "%s%s", listen, info->vncunused ? ",to=99" : "");
         else
-            flexarray_append(dm_args,
-                    libxl__sprintf(gc, "%s:%d%s", listen, display,
-                        info->vncunused ? ",to=99" : ""));
+            vncoptions = libxl__sprintf(gc, "%s:%d%s", listen, display,
+                                        info->vncunused ? ",to=99" : "");
+
+        if (info->vncpasswd && info->vncpasswd[0])
+            vncoptions = libxl__sprintf(gc, "%s,password", vncoptions);
+
+        flexarray_append(dm_args, "-vnc");
+        flexarray_append(dm_args, vncoptions);
     }
     if (info->sdl) {
         flexarray_append(dm_args, "-sdl");

-- 
Zhou Peng
Operating System Technology Group
Institute of Software, the Chinese Academy of Sciences (ISCAS)

[-- Attachment #2: tools-libxl-vncoptions.diff --]
[-- Type: text/x-patch, Size: 1968 bytes --]

This pacth clean up vnc options preparing code for xen-upstream-qemu.
Add password option which allows you to use vncpasswd auth by xl.


Signed-off-by: Zhou Peng <zhoupeng@nfs.iscas.ac.cn>

tools/libxl: prepare vnc options for dm_args in libxl__build_device_model_args_new

diff -r 569abaf2cc12 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Tue Apr 19 13:17:14 2011 +0800
+++ b/tools/libxl/libxl_dm.c	Wed Apr 20 13:47:42 2011 +0800
@@ -208,11 +208,7 @@ static char ** libxl__build_device_model
     if (info->vnc || info->vncdisplay || info->vnclisten || info->vncunused) {
         int display = 0;
         const char *listen = "127.0.0.1";
-
-        if (info->vncpasswd && info->vncpasswd[0]) {
-            assert(!"missing code for supplying vnc password to qemu");
-        }
-        flexarray_append(dm_args, "-vnc");
+        char *vncoptions = NULL;
 
         if (info->vncdisplay) {
             display = info->vncdisplay;
@@ -224,13 +220,17 @@ static char ** libxl__build_device_model
         }
 
         if (strchr(listen, ':') != NULL)
-            flexarray_append(dm_args, 
-                    libxl__sprintf(gc, "%s%s", listen,
-                        info->vncunused ? ",to=99" : ""));
+            vncoptions = libxl__sprintf(gc, 
+                             "%s%s", listen, info->vncunused ? ",to=99" : "");
         else
-            flexarray_append(dm_args, 
-                    libxl__sprintf(gc, "%s:%d%s", listen, display,
-                        info->vncunused ? ",to=99" : ""));
+            vncoptions = libxl__sprintf(gc, "%s:%d%s", listen, display,
+                                        info->vncunused ? ",to=99" : "");
+
+        if (info->vncpasswd && info->vncpasswd[0])
+            vncoptions = libxl__sprintf(gc, "%s,password", vncoptions);
+
+        flexarray_append(dm_args, "-vnc");
+        flexarray_append(dm_args, vncoptions);
     }
     if (info->sdl) {
         flexarray_append(dm_args, "-sdl");

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

             reply	other threads:[~2011-04-20  6:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20  6:30 ZhouPeng [this message]
2011-04-20 12:10 ` [PATCH] tools/libxl: prepare vnc options for dm_args in libxl__build_device_model_args_new Stefano Stabellini
2011-04-21  1:35   ` ZhouPeng
2011-05-09 12:30 ` Ian Jackson
2011-05-10 11:32   ` ZhouPeng

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=BANLkTimAoF-wuMrL4Zunjzy7QRV_xv_3ZA@mail.gmail.com \
    --to=zpengxen@gmail.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=stefano.stabellini@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).