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

[Xen-devel] [PATCH] tools/libxl: prepare vnc options for dm_args in libxl__build_device_model_args_new


  • To: "ian.jackson" <Ian.Jackson@xxxxxxxxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
  • From: ZhouPeng <zpengxen@xxxxxxxxx>
  • Date: Wed, 20 Apr 2011 14:30:36 +0800
  • Cc: "Xen-Devel \(E-mail\)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 19 Apr 2011 23:31:29 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=ti/Ef+L6CHTtY507DNPfnK5DeWD3yvdCsEEiDKhOlD3EpBZlqJfgjY5sbpwzODOwIl o3hRWyaFyX3KsN25VJT9oqtEIOLvpqgrqwZ6oB9OgwBV0TJeG46cd9Lt7An8Z8caO9oS 4XMwMy5AnBcSWQUuF9rNdt0GQRu0p7FBqP1k8=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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@xxxxxxxxxxxxxxx>

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: tools-libxl-vncoptions.diff
Description: Text Data

_______________________________________________
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®.