debuggers.hg

view tools/ioemu/patches/xenstore-write-vnc-port @ 10976:36cf965711f6

[qemu patches] Refresh patches.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Fri Aug 04 10:53:11 2006 +0100 (2006-08-04)
parents 7e914d9cd7e6
children 253498168658
line source
1 Index: ioemu/xenstore.c
2 ===================================================================
3 --- ioemu.orig/xenstore.c 2006-08-04 10:53:04.660489174 +0100
4 +++ ioemu/xenstore.c 2006-08-04 10:53:04.865465494 +0100
5 @@ -185,3 +185,31 @@
6 free(image);
7 free(vec);
8 }
9 +
10 +void xenstore_write_vncport(int display)
11 +{
12 + char *buf = NULL, *path;
13 + char *portstr = NULL;
14 +
15 + if (xsh == NULL)
16 + return;
17 +
18 + path = xs_get_domain_path(xsh, domid);
19 + if (path == NULL) {
20 + fprintf(logfile, "xs_get_domain_path() error\n");
21 + goto out;
22 + }
23 +
24 + if (pasprintf(&buf, "%s/console/vnc-port", path) == -1)
25 + goto out;
26 +
27 + if (pasprintf(&portstr, "%d", 5900 + display) == -1)
28 + goto out;
29 +
30 + if (xs_write(xsh, XBT_NULL, buf, portstr, strlen(portstr)) == 0)
31 + fprintf(logfile, "xs_write() vncport failed\n");
32 +
33 + out:
34 + free(portstr);
35 + free(buf);
36 +}
37 Index: ioemu/vl.c
38 ===================================================================
39 --- ioemu.orig/vl.c 2006-08-04 10:53:04.663488828 +0100
40 +++ ioemu/vl.c 2006-08-04 10:53:04.868465147 +0100
41 @@ -5974,6 +5974,7 @@
42 vnc_display_init(ds, vnc_display);
43 if (vncviewer)
44 vnc_start_viewer(vnc_display);
45 + xenstore_write_vncport(vnc_display);
46 } else {
47 #if defined(CONFIG_SDL)
48 sdl_display_init(ds, full_screen);
49 Index: ioemu/vl.h
50 ===================================================================
51 --- ioemu.orig/vl.h 2006-08-04 10:53:04.665488597 +0100
52 +++ ioemu/vl.h 2006-08-04 10:53:04.869465032 +0100
53 @@ -1112,6 +1112,7 @@
54 int xenstore_fd(void);
55 void xenstore_process_event(void *opaque);
56 void xenstore_check_new_media_present(int timeout);
57 +void xenstore_write_vncport(int vnc_display);
60 void kqemu_record_dump(void);