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

[Xen-devel] [PATCH] libxl/libxl_dm.c: Enable websocket functionality


  • To: <xen-devel@xxxxxxxxxxxxx>
  • From: "Alex Braunegg" <alex.braunegg@xxxxxxxxx>
  • Date: Thu, 4 Feb 2016 08:50:22 +1100
  • Delivery-date: Wed, 03 Feb 2016 21:50:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>
  • Thread-index: AdFezOH96aXTKgfdQxK7Ty2gZcUrbg==

Hi all,

I have been testing the Xen 4.6.0 packages - however there is no way that I
have found to enable websocket support in any of the xen / qemu
configuration files. 

The only way that I have been able to do this is with the following patch -
which works perfectly for my use case on a CentOS 6.x derived system:

-------------------------------------
diff -uNr xen-4.6.0.original/tools/libxl/libxl_dm.c
xen-4.6.0.modified/tools/libxl/libxl_dm.c
--- xen-4.6.0.original/tools/libxl/libxl_dm.c   2015-10-06
01:33:39.000000000 +1100
+++ xen-4.6.0.modified/tools/libxl/libxl_dm.c   2016-01-29
08:50:18.860371704 +1100
@@ -440,11 +440,11 @@
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = libxl__sprintf(gc,
"%s:%d,websocket,x509=/etc/pki/xen", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = libxl__sprintf(gc,
"127.0.0.1:%d,websocket,x509=/etc/pki/xen", vnc->display);

         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
@@ -806,11 +806,11 @@
                 }
                 vncarg = vnc->listen;
             } else {
-                vncarg = libxl__sprintf(gc, "%s:%d", vnc->listen,
+                vncarg = libxl__sprintf(gc,
"%s:%d,websocket,x509=/etc/pki/xen", vnc->listen,
                                         vnc->display);
             }
         } else
-            vncarg = libxl__sprintf(gc, "127.0.0.1:%d", vnc->display);
+            vncarg = libxl__sprintf(gc,
"127.0.0.1:%d,websocket,x509=/etc/pki/xen", vnc->display);

         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
-------------------------------------

This however introduces 2 hard-coded items:
        - Websocket will be enabled each time VNC is enabled.
        - x509 certificate path

By default, the websocket port mirrors the vnc port = so vnc port = 5900,
then websocket port = 5700 and so on. 

A better solution however in my mind would be to store the websocket & x509
path in the .cfg file for each virtual machine:

-------------------------------------
vnc=1
vncconsole=1
vnclisten='0.0.0.0'
vncpasswd='abcd1234'
vncdisplay=0
websocket=1             <- where 0 = disabled, 1 = enabled
x509={path}             <- File system path to x509 files to cater for OS
system variance or user preference, would also allow for different
certificates per websocket connection if required
-------------------------------------

Best regards,

Alex


















_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.