ia64/xen-unstable

view tools/ioemu/patches/vnc-start-vncviewer @ 11569:317e8516d464

[qemu patches] Update patches for changeset 11561:c742b2ae920c.

Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
author Christian Limpach <Christian.Limpach@xensource.com>
date Thu Sep 21 19:28:35 2006 +0100 (2006-09-21)
parents a7dcafb540be
children 7706696ff532
line source
1 Index: ioemu/vnc.c
2 ===================================================================
3 --- ioemu.orig/vnc.c 2006-09-21 19:10:45.000000000 +0100
4 +++ ioemu/vnc.c 2006-09-21 19:10:53.000000000 +0100
5 @@ -1173,3 +1173,25 @@
7 vnc_dpy_resize(vs->ds, 640, 400);
8 }
9 +
10 +int vnc_start_viewer(int port)
11 +{
12 + int pid;
13 + char s[16];
14 +
15 + sprintf(s, ":%d", port);
16 +
17 + switch (pid = fork()) {
18 + case -1:
19 + fprintf(stderr, "vncviewer failed fork\n");
20 + exit(1);
21 +
22 + case 0: /* child */
23 + execlp("vncviewer", "vncviewer", s, 0);
24 + fprintf(stderr, "vncviewer execlp failed\n");
25 + exit(1);
26 +
27 + default:
28 + return pid;
29 + }
30 +}
31 Index: ioemu/vl.c
32 ===================================================================
33 --- ioemu.orig/vl.c 2006-09-21 19:08:38.000000000 +0100
34 +++ ioemu/vl.c 2006-09-21 19:10:53.000000000 +0100
35 @@ -120,6 +120,7 @@
36 int bios_size;
37 static DisplayState display_state;
38 int nographic;
39 +int vncviewer;
40 const char* keyboard_layout = NULL;
41 int64_t ticks_per_sec;
42 int boot_device = 'c';
43 @@ -5340,6 +5341,7 @@
44 #endif
45 "-loadvm file start right away with a saved state (loadvm in monitor)\n"
46 "-vnc display start a VNC server on display\n"
47 + "-vncviewer start a vncviewer process for this domain\n"
48 "-timeoffset time offset (in seconds) from local time\n"
49 "-acpi disable or enable ACPI of HVM domain \n"
50 "\n"
51 @@ -5428,6 +5430,7 @@
52 QEMU_OPTION_vcpus,
53 QEMU_OPTION_timeoffset,
54 QEMU_OPTION_acpi,
55 + QEMU_OPTION_vncviewer,
56 };
58 typedef struct QEMUOption {
59 @@ -5502,6 +5505,7 @@
60 { "usbdevice", HAS_ARG, QEMU_OPTION_usbdevice },
61 { "smp", HAS_ARG, QEMU_OPTION_smp },
62 { "vnc", HAS_ARG, QEMU_OPTION_vnc },
63 + { "vncviewer", 0, QEMU_OPTION_vncviewer },
65 /* temporary options */
66 { "usb", 0, QEMU_OPTION_usb },
67 @@ -5868,6 +5872,7 @@
68 #endif
69 snapshot = 0;
70 nographic = 0;
71 + vncviewer = 0;
72 kernel_filename = NULL;
73 kernel_cmdline = "";
74 #ifdef TARGET_PPC
75 @@ -6262,6 +6267,9 @@
76 case QEMU_OPTION_acpi:
77 acpi_enabled = 1;
78 break;
79 + case QEMU_OPTION_vncviewer:
80 + vncviewer++;
81 + break;
82 }
83 }
84 }
85 @@ -6476,6 +6484,8 @@
86 dumb_display_init(ds);
87 } else if (vnc_display != -1) {
88 vnc_display_init(ds, vnc_display);
89 + if (vncviewer)
90 + vnc_start_viewer(vnc_display);
91 } else {
92 #if defined(CONFIG_SDL)
93 sdl_display_init(ds, full_screen);
94 Index: ioemu/vl.h
95 ===================================================================
96 --- ioemu.orig/vl.h 2006-09-21 19:08:38.000000000 +0100
97 +++ ioemu/vl.h 2006-09-21 19:10:53.000000000 +0100
98 @@ -786,6 +786,7 @@
100 /* vnc.c */
101 void vnc_display_init(DisplayState *ds, int display);
102 +int vnc_start_viewer(int port);
104 /* ide.c */
105 #define MAX_DISKS 4