* [PATCH] libxl/libxl_dm.c: Enable websocket functionality
@ 2016-02-03 21:50 Alex Braunegg
2016-02-04 10:50 ` Ian Campbell
0 siblings, 1 reply; 2+ messages in thread
From: Alex Braunegg @ 2016-02-03 21:50 UTC (permalink / raw)
To: xen-devel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libxl/libxl_dm.c: Enable websocket functionality
2016-02-03 21:50 [PATCH] libxl/libxl_dm.c: Enable websocket functionality Alex Braunegg
@ 2016-02-04 10:50 ` Ian Campbell
0 siblings, 0 replies; 2+ messages in thread
From: Ian Campbell @ 2016-02-04 10:50 UTC (permalink / raw)
To: Alex Braunegg, xen-devel
On Thu, 2016-02-04 at 08:50 +1100, Alex Braunegg wrote:
> A better solution however in my mind would be to store the websocket & x509
> path in the .cfg file for each virtual machine:
Correct. This would involve adding the appropriate fields to the struct(s)
in tools/libxl/libxl_types.idl, populating them from the xl cfg parser
(xl_cmdimple.c) and obeying them in the code you have patched above.
Please also see http://wiki.xen.org/wiki/Submitting_Xen_Patches for
guidance on submitting patches to Xen, in particular the requirement for a
Signed-off-by (and what that means).
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-02-04 10:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-03 21:50 [PATCH] libxl/libxl_dm.c: Enable websocket functionality Alex Braunegg
2016-02-04 10:50 ` Ian Campbell
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).