Skip to contentSkip to conversation

vnclisten for paravirt FB

PATCH New Daniel P. Berrange 1 participant 1 message Sep 29, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vnclisten for paravirt FB

This patch adds support for the 'vnclisten' parameter to the paravirt framebuffer. It has a dependancy on the paravirt framebuffer patches, and the 3rd iteration of the HVM vnclisten patches. The patch was originally written by Jeremy Katz, adapted by myself to make it pull default setting from /etc/xend-config.sxp if no per-guest setting for vnclisten is present.

Regards,
Dan.

Signature · 4 lines
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 
tools/python/xen/xend/image.py +5 -0
diff -ru xen-3.0.3-testing-11633.vnclisten/tools/python/xen/xend/image.py xen-3.0.3-testing-11633.vnclisten-pvfb/tools/python/xen/xend/image.py
@@ -225,6 +225,9 @@
             self.vncdisplay = sxp.child_value(imageConfig, 'vncdisplay',
                                               int(self.vm.getDomid()))
             self.vncunused = sxp.child_value(imageConfig, 'vncunused')
+            self.vnclisten = sxp.child_value(imageConfig, 'vnclisten')
+            if not(self.vnclisten):
+                self.vnclisten = xen.xend.XendRoot.instance().get_vnclisten_address()
         if self.vnc or self.sdl:
             log.info("setting use_graphics")
             self.vm.writeDom("console/use_graphics", "1")
@@ -244,6 +247,8 @@
                 args += ['--unused']
             elif self.vncdisplay:
                 args += [ "--vncport", "%d" %(5900 + self.vncdisplay,) ]
+            if self.vnclisten:
+                args += [ "--listen", self.vnclisten ]
         elif self.sdl:
             args = [xen.util.auxbin.pathTo("xen-sdlfb")]
         args = args + [ "--domid", "%d" % self.vm.getDomid(),
tools/xenfb/vncfb.c +11 -2
diff -ru xen-3.0.3-testing-11633.vnclisten/tools/xenfb/vncfb.c xen-3.0.3-testing-11633.vnclisten-pvfb/tools/xenfb/vncfb.c
@@ -89,16 +89,19 @@
     { "vncport", 1, NULL, 'p' },
     { "title", 1, NULL, 't' },
     { "unused", 0, NULL, 'u' },
+    { "listen", 1, NULL, 'l' },
 };
 
 int main(int argc, char **argv)
 {
 	rfbScreenInfoPtr server;
-	char *fake_argv[5] = { "vncfb", "-rfbport", "5901", 
-                               "-desktop", "xen-vncfb" };
+	char *fake_argv[7] = { "vncfb", "-rfbport", "5901", 
+                               "-desktop", "xen-vncfb", 
+                               "-listen", "0.0.0.0" };
 	int fake_argc = sizeof(fake_argv) / sizeof(fake_argv[0]);
 	int domid = -1, port = -1;
         char * title = NULL;
+        char * listen = NULL;
 	struct xenfb *xenfb;
 	fd_set readfds;
 	int fd;
@@ -121,6 +124,9 @@
                 case 'u':
                     unused = TRUE;
                     break;
+                case 'l':
+                    listen = strdup(optarg);
+                    break;
                 }
         }
         if (optind != argc) {
@@ -140,6 +146,9 @@
         if (title != NULL)
             fake_argv[4] = title;
 
+        if (listen != NULL)
+            fake_argv[6] = listen;
+
 	signal(SIGPIPE, SIG_IGN);
 
 	xenfb = xenfb_new();

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