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

[Xen-changelog] [xen-unstable] [qemu] Write the port number where the vnc server is listening to xenstore.



# HG changeset patch
# User chris@xxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 155385a02d0b3c57b079a3ce234d057e812605fa
# Parent  955f02563a13288d227c3d332c90a3f644a4d9bf
[qemu] Write the port number where the vnc server is listening to xenstore.

Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxxx>
---
 tools/ioemu/vl.c       |    1 +
 tools/ioemu/vl.h       |    1 +
 tools/ioemu/xenstore.c |   28 ++++++++++++++++++++++++++++
 3 files changed, 30 insertions(+)

diff -r 955f02563a13 -r 155385a02d0b tools/ioemu/vl.c
--- a/tools/ioemu/vl.c  Thu Aug 03 18:34:03 2006 +0100
+++ b/tools/ioemu/vl.c  Thu Aug 03 19:14:41 2006 +0100
@@ -5954,6 +5954,7 @@ int main(int argc, char **argv)
        vnc_display_init(ds, vnc_display);
        if (vncviewer)
            vnc_start_viewer(vnc_display);
+       xenstore_write_vncport(vnc_display);
     } else {
 #if defined(CONFIG_SDL)
         sdl_display_init(ds, full_screen);
diff -r 955f02563a13 -r 155385a02d0b tools/ioemu/vl.h
--- a/tools/ioemu/vl.h  Thu Aug 03 18:34:03 2006 +0100
+++ b/tools/ioemu/vl.h  Thu Aug 03 19:14:41 2006 +0100
@@ -1111,6 +1111,7 @@ int xenstore_fd(void);
 int xenstore_fd(void);
 void xenstore_process_event(void *opaque);
 void xenstore_check_new_media_present(int timeout);
+void xenstore_write_vncport(int vnc_display);
 
 
 void kqemu_record_dump(void);
diff -r 955f02563a13 -r 155385a02d0b tools/ioemu/xenstore.c
--- a/tools/ioemu/xenstore.c    Thu Aug 03 18:34:03 2006 +0100
+++ b/tools/ioemu/xenstore.c    Thu Aug 03 19:14:41 2006 +0100
@@ -185,3 +185,31 @@ void xenstore_process_event(void *opaque
     free(image);
     free(vec);
 }
+
+void xenstore_write_vncport(int display)
+{
+    char *buf = NULL, *path;
+    char *portstr = NULL;
+
+    if (xsh == NULL)
+       return;
+
+    path = xs_get_domain_path(xsh, domid);
+    if (path == NULL) {
+        fprintf(logfile, "xs_get_domain_path() error\n");
+        goto out;
+    }
+
+    if (pasprintf(&buf, "%s/console/vnc-port", path) == -1)
+       goto out;
+
+    if (pasprintf(&portstr, "%d", 5900 + display) == -1)
+       goto out;
+
+    if (xs_write(xsh, XBT_NULL, buf, portstr, strlen(portstr)) == 0)
+        fprintf(logfile, "xs_write() vncport failed\n");
+
+ out:
+    free(portstr);
+    free(buf);
+}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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