debuggers.hg

view tools/ioemu/patches/xenstore-write-vnc-port @ 10962:646092d50e82

[qemu patches] Update patches for changeset 10923:155385a02d.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author chris@kneesaa.uk.xensource.com
date Thu Aug 03 19:19:27 2006 +0100 (2006-08-03)
parents
children 7e914d9cd7e6
line source
1 Index: ioemu/xenstore.c
2 ===================================================================
3 --- ioemu.orig/xenstore.c 2006-08-03 19:17:18.496119877 +0100
4 +++ ioemu/xenstore.c 2006-08-03 19:18:29.428258503 +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-03 19:17:18.499119544 +0100
40 +++ ioemu/vl.c 2006-08-03 19:18:29.427258614 +0100
41 @@ -5954,6 +5954,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-03 19:17:18.501119323 +0100
52 +++ ioemu/vl.h 2006-08-03 19:18:29.428258503 +0100
53 @@ -1111,6 +1111,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);