debuggers.hg

view tools/ioemu/patches/domain-reset @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children
line source
1 Index: ioemu/target-i386-dm/helper2.c
2 ===================================================================
3 --- ioemu.orig/target-i386-dm/helper2.c 2007-05-09 13:43:01.000000000 +0100
4 +++ ioemu/target-i386-dm/helper2.c 2007-05-09 13:44:09.000000000 +0100
5 @@ -127,6 +127,22 @@
6 /* called from main_cpu_reset */
7 void cpu_reset(CPUX86State *env)
8 {
9 + int xcHandle;
10 + int sts;
11 +
12 + xcHandle = xc_interface_open();
13 + if (xcHandle < 0)
14 + fprintf(logfile, "Cannot acquire xenctrl handle\n");
15 + else {
16 + sts = xc_domain_shutdown(xcHandle, domid, SHUTDOWN_reboot);
17 + if (sts != 0)
18 + fprintf(logfile,
19 + "? xc_domain_shutdown failed to issue reboot, sts %d\n",
20 + sts);
21 + else
22 + fprintf(logfile, "Issued domain %d reboot\n", domid);
23 + xc_interface_close(xcHandle);
24 + }
25 }
27 void cpu_x86_close(CPUX86State *env)
28 @@ -529,14 +545,9 @@
30 qemu_set_fd_handler(evtchn_fd, cpu_handle_ioreq, NULL, env);
32 - while (1) {
33 - if (vm_running) {
34 - if (shutdown_requested)
35 - break;
36 - }
37 -
38 + while (!(vm_running && suspend_requested))
39 /* Wait up to 10 msec. */
40 main_loop_wait(10);
41 - }
42 +
43 return 0;
44 }
45 Index: ioemu/vl.c
46 ===================================================================
47 --- ioemu.orig/vl.c 2007-05-09 13:43:02.000000000 +0100
48 +++ ioemu/vl.c 2007-05-09 13:44:20.000000000 +0100
49 @@ -5843,7 +5843,7 @@
50 } QEMUResetEntry;
52 static QEMUResetEntry *first_reset_entry;
53 -static int reset_requested;
54 +int reset_requested;
55 int shutdown_requested;
56 static int powerdown_requested;
58 @@ -5861,7 +5861,7 @@
59 *pre = re;
60 }
62 -static void qemu_system_reset(void)
63 +void qemu_system_reset(void)
64 {
65 QEMUResetEntry *re;
67 Index: ioemu/vl.h
68 ===================================================================
69 --- ioemu.orig/vl.h 2007-05-09 13:43:01.000000000 +0100
70 +++ ioemu/vl.h 2007-05-09 13:44:09.000000000 +0100
71 @@ -136,6 +136,7 @@
73 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
74 void qemu_system_reset_request(void);
75 +void qemu_system_reset(void);
76 void qemu_system_shutdown_request(void);
77 void qemu_system_powerdown_request(void);
78 #if !defined(TARGET_SPARC)
79 @@ -145,6 +146,8 @@
80 void qemu_system_powerdown(void);
81 #endif
83 +extern int reset_requested;
84 +
85 void main_loop_wait(int timeout);
87 extern FILE *logfile;