source: trunk/packages/xen-common/xen-common/tools/ioemu/patches/domain-reset @ 34

Last change on this file since 34 was 34, checked in by hartmans, 18 years ago

Add xen and xen-common

File size: 2.2 KB
Line 
1Index: ioemu/target-i386-dm/helper2.c
2===================================================================
3--- ioemu.orig/target-i386-dm/helper2.c 2007-05-03 14:54:46.000000000 +0100
4+++ ioemu/target-i386-dm/helper2.c      2007-05-03 14:55:00.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 }
26 
27 void cpu_x86_close(CPUX86State *env)
28@@ -529,14 +545,9 @@
29 
30     qemu_set_fd_handler(evtchn_fd, cpu_handle_ioreq, NULL, env);
31 
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 }
45Index: ioemu/vl.c
46===================================================================
47--- ioemu.orig/vl.c     2007-05-03 14:55:00.000000000 +0100
48+++ ioemu/vl.c  2007-05-03 14:55:00.000000000 +0100
49@@ -4957,7 +4957,7 @@
50 } QEMUResetEntry;
51 
52 static QEMUResetEntry *first_reset_entry;
53-static int reset_requested;
54+int reset_requested;
55 int shutdown_requested;
56 static int powerdown_requested;
57 
58Index: ioemu/vl.h
59===================================================================
60--- ioemu.orig/vl.h     2007-05-03 14:55:00.000000000 +0100
61+++ ioemu/vl.h  2007-05-03 14:55:00.000000000 +0100
62@@ -131,6 +131,7 @@
63 
64 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
65 void qemu_system_reset_request(void);
66+void qemu_system_reset(void);
67 void qemu_system_shutdown_request(void);
68 void qemu_system_powerdown_request(void);
69 #if !defined(TARGET_SPARC)
70@@ -140,6 +141,8 @@
71 void qemu_system_powerdown(void);
72 #endif
73 
74+extern int reset_requested;
75+
76 void main_loop_wait(int timeout);
77 
78 extern FILE *logfile;
Note: See TracBrowser for help on using the repository browser.