Skip to contentSkip to conversation

vncpassword support in libxl

PATHCH In review Gihan Munasinghe 4 participants 10 messages May 6, 2010 – May 7, 2010

lore
Share & tools
lore
#0 lore raw

Guys

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

Thank

Signature · 4 lines
Gihan Munasinghe
R&D Team Leader
Flexiant Ltd.
www.flexiant.com
tools/libxl/libxl.c renamed from xen-4.0.0/tools/libxl/libxl.c +34 -3
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.c xen-4.0.0/tools/libxl/libxl.c
@@ -186,7 +186,7 @@
     if (info->hvm) {
         ret = build_hvm(ctx, domid, info, state);
         if (ret) goto out;
-
+	
         vments = libxl_calloc(ctx, 5, sizeof(char *));
         vments[0] = "rtc/timeoffset";
         vments[1] = (info->u.hvm.timeoffset) ? info->u.hvm.timeoffset : "";
@@ -663,7 +663,11 @@
         flexarray_set(dm_args, num++, "-vnc");
         if (info->vncdisplay) {
             if (info->vnclisten && strchr(info->vnclisten, ':') == NULL) {
-                flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		if(info->vncpasswd){
+                    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d,password", info->vnclisten, info->vncdisplay));
+		}else{
+		    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		}
             } else {
                 flexarray_set(dm_args, num++, libxl_sprintf(ctx, "127.0.0.1:%d", info->vncdisplay));
             }
@@ -786,6 +790,7 @@
     vfb->vnclisten = info->vnclisten;
     vfb->vncdisplay = info->vncdisplay;
     vfb->vncunused = info->vncunused;
+    vfb->vncpasswd = info->vncpasswd;
     vfb->keymap = info->keymap;
     vfb->sdl = info->sdl;
     vfb->opengl = info->opengl;
@@ -1012,10 +1017,32 @@
     p->dom_path = libxl_xs_get_dompath(ctx, info->domid);
     if (!p->dom_path) { libxl_free(ctx, p); return ERROR_FAIL; }
 
+    xs_transaction_t t; 
+    char *vm_path;	
+    char **pass_stuff;
+    if(info->vncpasswd){
+       retry_transaction:
+    //Supporting vnc password 
+    // Need to find uuid and the write the vnc password to xenstore so that qemu can pick it up
+	 t = xs_transaction_start(ctx->xsh);
+	 vm_path = libxl_xs_read(ctx,t,libxl_sprintf(ctx, "%s/vm", p->dom_path));
+	 if(vm_path){
+		//Now write the vncpassword in to it
+	    pass_stuff = libxl_calloc(ctx, 2, sizeof(char *));
+	    pass_stuff[0] = "vncpasswd";
+	    pass_stuff[1] = info->vncpasswd;
+	    libxl_xs_writev(ctx,t,vm_path,pass_stuff);
+            if (!xs_transaction_end(ctx->xsh, t, 0))
+            	if (errno == EAGAIN)
+                	goto retry_transaction; 
+	    } 
+	
+    }
+
     rc = libxl_spawn_spawn(ctx, p, "device model", dm_xenstore_record_pid);
     if (rc < 0) goto xit;
     if (!rc) { /* inner child */
-        libxl_exec(null, logfile_w, logfile_w,
+	libxl_exec(null, logfile_w, logfile_w,
                    info->device_model, args);
     }
 
@@ -1571,6 +1598,8 @@
         info->vnclisten = libxl_sprintf(ctx, "%s", vfb->vnclisten);
     info->vncdisplay = vfb->vncdisplay;
     info->vncunused = vfb->vncunused;
+    if(vfb->vncpasswd)
+        info->vncpasswd = vfb->vncpasswd;
     if (vfb->keymap)
         info->keymap = libxl_sprintf(ctx, "%s", vfb->keymap);
     info->sdl = vfb->sdl;
@@ -1652,6 +1681,8 @@
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vnc));
     flexarray_set(back, boffset++, "vnclisten");
     flexarray_set(back, boffset++, vfb->vnclisten);
+    flexarray_set(back, boffset++, "vncpasswd");
+    flexarray_set(back, boffset++, vfb->vncpasswd);
     flexarray_set(back, boffset++, "vncdisplay");
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vncdisplay));
     flexarray_set(back, boffset++, "vncunused");
tools/libxl/libxl.h renamed from xen-4.0.0/tools/libxl/libxl.h +2 -0
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.h xen-4.0.0/tools/libxl/libxl.h
@@ -128,6 +128,7 @@
     bool stdvga; /* stdvga enabled or disabled */
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
@@ -149,6 +150,7 @@
     int devid;
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
tools/libxl/xl.c renamed from xen-4.0.0/tools/libxl/xl.c +6 -1
diff -Naur vanila/xen-4.0.0/tools/libxl/xl.c xen-4.0.0/tools/libxl/xl.c
@@ -561,6 +561,8 @@
                     (*vfbs)[*num_vfbs].vnc = atoi(p2 + 1);
                 } else if (!strcmp(p, "vnclisten")) {
                     (*vfbs)[*num_vfbs].vnclisten = strdup(p2 + 1);
+		} else if (!strcmp(p, "vncpasswd")) {
+                    (*vfbs)[*num_vfbs].vncpasswd = strdup(p2 + 1);
                 } else if (!strcmp(p, "vncdisplay")) {
                     (*vfbs)[*num_vfbs].vncdisplay = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
@@ -639,6 +641,8 @@
             dm_info->vnc = l;
         if (!xlu_cfg_get_string (config, "vnclisten", &buf))
             dm_info->vnclisten = strdup(buf);
+	if (!xlu_cfg_get_string (config, "vncpasswd", &buf))
+            dm_info->vncpasswd = strdup(buf);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l))
             dm_info->vncdisplay = l;
         if (!xlu_cfg_get_long (config, "vncunused", &l))
@@ -697,7 +701,6 @@
     libxl_waiter *w1 = NULL, *w2 = NULL;
     memset(&dm_info, 0x00, sizeof(dm_info));
 
-    printf("Parsing config file %s\n", config_file);
     parse_config_file(config_file, &info1, &info2, &disks, &num_disks, &vifs, &num_vifs, &pcidevs, &num_pcidevs, &vfbs, &num_vfbs, &vkbs, &num_vkbs, &dm_info);
     if (debug)
         printf_info(&info1, &info2, disks, num_disks, vifs, num_vifs, pcidevs, num_pcidevs, vfbs, num_vfbs, vkbs, num_vkbs, &dm_info);
@@ -718,12 +721,14 @@
         return;
     }
 
+
     if (!restore_file || !need_daemon) {
         if (dm_info.saved_state) {
             free(dm_info.saved_state);
             dm_info.saved_state = NULL;
         }
         ret = libxl_domain_build(&ctx, &info2, domid, &state);
+	
     } else {
         int restore_fd;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

PATCH 1/1 vncpassword support in libxl

Guys

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

Thanks Gihan

tools/libxl/libxl.c renamed from xen-4.0.0/tools/libxl/libxl.c +34 -3
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.c xen-4.0.0/tools/libxl/libxl.c
@@ -186,7 +186,7 @@
     if (info->hvm) {
         ret = build_hvm(ctx, domid, info, state);
         if (ret) goto out;
-
+	
         vments = libxl_calloc(ctx, 5, sizeof(char *));
         vments[0] = "rtc/timeoffset";
         vments[1] = (info->u.hvm.timeoffset) ? info->u.hvm.timeoffset : "";
@@ -663,7 +663,11 @@
         flexarray_set(dm_args, num++, "-vnc");
         if (info->vncdisplay) {
             if (info->vnclisten && strchr(info->vnclisten, ':') == NULL) {
-                flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		if(info->vncpasswd){
+                    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d,password", info->vnclisten, info->vncdisplay));
+		}else{
+		    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		}
             } else {
                 flexarray_set(dm_args, num++, libxl_sprintf(ctx, "127.0.0.1:%d", info->vncdisplay));
             }
@@ -786,6 +790,7 @@
     vfb->vnclisten = info->vnclisten;
     vfb->vncdisplay = info->vncdisplay;
     vfb->vncunused = info->vncunused;
+    vfb->vncpasswd = info->vncpasswd;
     vfb->keymap = info->keymap;
     vfb->sdl = info->sdl;
     vfb->opengl = info->opengl;
@@ -1012,10 +1017,32 @@
     p->dom_path = libxl_xs_get_dompath(ctx, info->domid);
     if (!p->dom_path) { libxl_free(ctx, p); return ERROR_FAIL; }
 
+    xs_transaction_t t; 
+    char *vm_path;	
+    char **pass_stuff;
+    if(info->vncpasswd){
+       retry_transaction:
+    //Supporting vnc password 
+    // Need to find uuid and the write the vnc password to xenstore so that qemu can pick it up
+	 t = xs_transaction_start(ctx->xsh);
+	 vm_path = libxl_xs_read(ctx,t,libxl_sprintf(ctx, "%s/vm", p->dom_path));
+	 if(vm_path){
+		//Now write the vncpassword in to it
+	    pass_stuff = libxl_calloc(ctx, 2, sizeof(char *));
+	    pass_stuff[0] = "vncpasswd";
+	    pass_stuff[1] = info->vncpasswd;
+	    libxl_xs_writev(ctx,t,vm_path,pass_stuff);
+            if (!xs_transaction_end(ctx->xsh, t, 0))
+            	if (errno == EAGAIN)
+                	goto retry_transaction; 
+	    } 
+	
+    }
+
     rc = libxl_spawn_spawn(ctx, p, "device model", dm_xenstore_record_pid);
     if (rc < 0) goto xit;
     if (!rc) { /* inner child */
-        libxl_exec(null, logfile_w, logfile_w,
+	libxl_exec(null, logfile_w, logfile_w,
                    info->device_model, args);
     }
 
@@ -1571,6 +1598,8 @@
         info->vnclisten = libxl_sprintf(ctx, "%s", vfb->vnclisten);
     info->vncdisplay = vfb->vncdisplay;
     info->vncunused = vfb->vncunused;
+    if(vfb->vncpasswd)
+        info->vncpasswd = vfb->vncpasswd;
     if (vfb->keymap)
         info->keymap = libxl_sprintf(ctx, "%s", vfb->keymap);
     info->sdl = vfb->sdl;
@@ -1652,6 +1681,8 @@
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vnc));
     flexarray_set(back, boffset++, "vnclisten");
     flexarray_set(back, boffset++, vfb->vnclisten);
+    flexarray_set(back, boffset++, "vncpasswd");
+    flexarray_set(back, boffset++, vfb->vncpasswd);
     flexarray_set(back, boffset++, "vncdisplay");
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vncdisplay));
     flexarray_set(back, boffset++, "vncunused");
tools/libxl/libxl.h renamed from xen-4.0.0/tools/libxl/libxl.h +2 -0
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.h xen-4.0.0/tools/libxl/libxl.h
@@ -128,6 +128,7 @@
     bool stdvga; /* stdvga enabled or disabled */
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
@@ -149,6 +150,7 @@
     int devid;
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
tools/libxl/xl.c renamed from xen-4.0.0/tools/libxl/xl.c +6 -1
diff -Naur vanila/xen-4.0.0/tools/libxl/xl.c xen-4.0.0/tools/libxl/xl.c
@@ -561,6 +561,8 @@
                     (*vfbs)[*num_vfbs].vnc = atoi(p2 + 1);
                 } else if (!strcmp(p, "vnclisten")) {
                     (*vfbs)[*num_vfbs].vnclisten = strdup(p2 + 1);
+		} else if (!strcmp(p, "vncpasswd")) {
+                    (*vfbs)[*num_vfbs].vncpasswd = strdup(p2 + 1);
                 } else if (!strcmp(p, "vncdisplay")) {
                     (*vfbs)[*num_vfbs].vncdisplay = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
@@ -639,6 +641,8 @@
             dm_info->vnc = l;
         if (!xlu_cfg_get_string (config, "vnclisten", &buf))
             dm_info->vnclisten = strdup(buf);
+	if (!xlu_cfg_get_string (config, "vncpasswd", &buf))
+            dm_info->vncpasswd = strdup(buf);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l))
             dm_info->vncdisplay = l;
         if (!xlu_cfg_get_long (config, "vncunused", &l))
@@ -697,7 +701,6 @@
     libxl_waiter *w1 = NULL, *w2 = NULL;
     memset(&dm_info, 0x00, sizeof(dm_info));
 
-    printf("Parsing config file %s\n", config_file);
     parse_config_file(config_file, &info1, &info2, &disks, &num_disks, &vifs, &num_vifs, &pcidevs, &num_pcidevs, &vfbs, &num_vfbs, &vkbs, &num_vkbs, &dm_info);
     if (debug)
         printf_info(&info1, &info2, disks, num_disks, vifs, num_vifs, pcidevs, num_pcidevs, vfbs, num_vfbs, vkbs, num_vkbs, &dm_info);
@@ -718,12 +721,14 @@
         return;
     }
 
+
     if (!restore_file || !need_daemon) {
         if (dm_info.saved_state) {
             free(dm_info.saved_state);
             dm_info.saved_state = NULL;
         }
         ret = libxl_domain_build(&ctx, &info2, domid, &state);
+	
     } else {
         int restore_fd;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v1 1/1
#2 lore raw
Quoted 13 lines · Gihan Munasinghe

Guys

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

Thanks
Gihan

The indentation is often wrong and sometimes you are adding\removing blank lines for no reason.
But apart from this small cosmetic issues the patch looks good.

#3 lore raw

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] vncpassword support in libxl"):

Quoted 3 lines

The indentation is often wrong and sometimes you are adding\removing blank lines for no reason.
But apart from this small cosmetic issues the patch looks good.

You missed that he removed this line:

- printf("Parsing config file %s\n", config_file);

This demonstrates why patches with spurious stuff in should be rejected - it's too easy to miss a mistake when scanning past a lot of spurious changes.

Ian.

#4 lore raw
Quoted 9 lines · Ian Jackson

Stefano Stabellini writes ("Re: [Xen-devel] [PATCH] vncpassword support in libxl"):

Quoted 4 lines

The indentation is often wrong and sometimes you are adding\removing blank lines for no reason.
But apart from this small cosmetic issues the patch looks good.

You missed that he removed this line:

Quoted 10 lines

- printf("Parsing config file %s\n", config_file);

This demonstrates why patches with spurious stuff in should be rejected - it's too easy to miss a mistake when scanning past a lot of spurious changes.

Ian.

Yes my mad will do the changes and resubmit again

#5 lore raw
In reply to Stefano Stabellini
Quoted 7 lines · Stefano Stabellini
Quoted 5 lines · Gihan Munasinghe

Guys

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

Quoted 9 lines
Quoted 4 lines

Thanks Gihan

The indentation is often wrong and sometimes you are adding\removing blank lines for no reason.
But apart from this small cosmetic issues the patch looks good.

Cool, I'll do the cosmetic changes and resubmit the patch

Quoted 9 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#6 lore raw
In reply to Gihan Munasinghe

Gihan Munasinghe writes ("[Xen-devel] [PATCH] vncpassword support in libxl"):

Quoted 5 lines

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

It looks like a mostly reasonable patch, thanks. However you have made a couple of apparently accidental changes:

- libxl_exec(null, logfile_w, logfile_w,
+ libxl_exec(null, logfile_w, logfile_w,
...
- printf("Parsing config file %s\n", config_file);

and so on.

Could people please review your patches by eye - yes, read every line
- before sending ?

In this case, please resubmit with only the necessary changes. While you're at it, you should probably ensure that you submit a patch which doesn't introduce tabs. I don't mind them but I know some people do. You may want (setq indent-tabs-mode nil) in Emacs.

Ian.

#7 lore raw
Quoted 14 lines · Ian Jackson

Gihan Munasinghe writes ("[Xen-devel] [PATCH] vncpassword support in libxl"):

Quoted 3 lines

When trying to move xen4.0 and libxl I found that libxl does not support vncpassword with in the device model.
Was there are particular reason this feature is not implemented . To get our vms ported in to xen4 and to change our management stack to use libxl. I have done the following patch what do you guys think.

It looks like a mostly reasonable patch, thanks. However you have made a couple of apparently accidental changes:

(quoted diff) +1 -2
-        libxl_exec(null, logfile_w, logfile_w,
+       libxl_exec(null, logfile_w, logfile_w,
...
-    printf("Parsing config file %s\n", config_file);
Quoted 2 lines

and so on.

Done

Quoted 5 lines

In this case, please resubmit with only the necessary changes. While you're at it, you should probably ensure that you submit a patch which doesn't introduce tabs. I don't mind them but I know some people do. You may want (setq indent-tabs-mode nil) in Emacs.

Made the code to use spaces as well

New patch attached

Thanks
Gihan

tools/libxl/libxl.c renamed from xen-4.0.0/tools/libxl/libxl.c +31 -1
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.c xen-4.0.0/tools/libxl/libxl.c
@@ -663,7 +663,11 @@
         flexarray_set(dm_args, num++, "-vnc");
         if (info->vncdisplay) {
             if (info->vnclisten && strchr(info->vnclisten, ':') == NULL) {
-                flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		if(info->vncpasswd){
+                    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d,password", info->vnclisten, info->vncdisplay));
+		}else{
+		    flexarray_set(dm_args, num++, libxl_sprintf(ctx, "%s:%d", info->vnclisten, info->vncdisplay));
+		}
             } else {
                 flexarray_set(dm_args, num++, libxl_sprintf(ctx, "127.0.0.1:%d", info->vncdisplay));
             }
@@ -786,6 +790,7 @@
     vfb->vnclisten = info->vnclisten;
     vfb->vncdisplay = info->vncdisplay;
     vfb->vncunused = info->vncunused;
+    vfb->vncpasswd = info->vncpasswd;
     vfb->keymap = info->keymap;
     vfb->sdl = info->sdl;
     vfb->opengl = info->opengl;
@@ -1012,6 +1017,27 @@
     p->dom_path = libxl_xs_get_dompath(ctx, info->domid);
     if (!p->dom_path) { libxl_free(ctx, p); return ERROR_FAIL; }
 
+    xs_transaction_t t; 
+    char *vm_path;	
+    char **pass_stuff;
+    if(info->vncpasswd){
+        retry_transaction:
+        //Supporting vnc password 
+        // Need to find uuid and the write the vnc password to xenstore so that qemu can pick it up
+            t = xs_transaction_start(ctx->xsh);
+            vm_path = libxl_xs_read(ctx,t,libxl_sprintf(ctx, "%s/vm", p->dom_path));
+            if(vm_path){
+           //Now write the vncpassword in to it
+                pass_stuff = libxl_calloc(ctx, 2, sizeof(char *));
+                pass_stuff[0] = "vncpasswd";
+                pass_stuff[1] = info->vncpasswd;
+                libxl_xs_writev(ctx,t,vm_path,pass_stuff);
+                if (!xs_transaction_end(ctx->xsh, t, 0))
+                    if (errno == EAGAIN)
+                        goto retry_transaction; 
+             } 
+    }
+
     rc = libxl_spawn_spawn(ctx, p, "device model", dm_xenstore_record_pid);
     if (rc < 0) goto xit;
     if (!rc) { /* inner child */
@@ -1571,6 +1597,8 @@
         info->vnclisten = libxl_sprintf(ctx, "%s", vfb->vnclisten);
     info->vncdisplay = vfb->vncdisplay;
     info->vncunused = vfb->vncunused;
+    if(vfb->vncpasswd)
+        info->vncpasswd = vfb->vncpasswd;
     if (vfb->keymap)
         info->keymap = libxl_sprintf(ctx, "%s", vfb->keymap);
     info->sdl = vfb->sdl;
@@ -1652,6 +1680,8 @@
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vnc));
     flexarray_set(back, boffset++, "vnclisten");
     flexarray_set(back, boffset++, vfb->vnclisten);
+    flexarray_set(back, boffset++, "vncpasswd");
+    flexarray_set(back, boffset++, vfb->vncpasswd);
     flexarray_set(back, boffset++, "vncdisplay");
     flexarray_set(back, boffset++, libxl_sprintf(ctx, "%d", vfb->vncdisplay));
     flexarray_set(back, boffset++, "vncunused");
tools/libxl/libxl.h renamed from xen-4.0.0/tools/libxl/libxl.h +2 -0
diff -Naur vanila/xen-4.0.0/tools/libxl/libxl.h xen-4.0.0/tools/libxl/libxl.h
@@ -128,6 +128,7 @@
     bool stdvga; /* stdvga enabled or disabled */
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
@@ -149,6 +150,7 @@
     int devid;
     bool vnc; /* vnc enabled or disabled */
     char *vnclisten; /* address:port that should be listened on for the VNC server if vnc is set */
+    char *vncpasswd; /* the VNC password */
     int vncdisplay; /* set VNC display number */
     bool vncunused; /* try to find an unused port for the VNC server */
     char *keymap; /* set keyboard layout, default is en-us keyboard */
tools/libxl/xl.c renamed from xen-4.0.0/tools/libxl/xl.c +4 -0
diff -Naur vanila/xen-4.0.0/tools/libxl/xl.c xen-4.0.0/tools/libxl/xl.c
@@ -561,6 +561,8 @@
                     (*vfbs)[*num_vfbs].vnc = atoi(p2 + 1);
                 } else if (!strcmp(p, "vnclisten")) {
                     (*vfbs)[*num_vfbs].vnclisten = strdup(p2 + 1);
+		} else if (!strcmp(p, "vncpasswd")) {
+                    (*vfbs)[*num_vfbs].vncpasswd = strdup(p2 + 1);
                 } else if (!strcmp(p, "vncdisplay")) {
                     (*vfbs)[*num_vfbs].vncdisplay = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
@@ -639,6 +641,8 @@
             dm_info->vnc = l;
         if (!xlu_cfg_get_string (config, "vnclisten", &buf))
             dm_info->vnclisten = strdup(buf);
+	if (!xlu_cfg_get_string (config, "vncpasswd", &buf))
+            dm_info->vncpasswd = strdup(buf);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l))
             dm_info->vncdisplay = l;
         if (!xlu_cfg_get_long (config, "vncunused", &l))

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel