source: trunk/packages/xen-3.1/xen-3.1/tools/ioemu/patches/domain-destroy @ 34

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

Add xen and xen-common

File size: 1.6 KB
Line 
1Index: ioemu/monitor.c
2===================================================================
3--- ioemu.orig/monitor.c        2007-05-03 14:54:59.000000000 +0100
4+++ ioemu/monitor.c     2007-05-03 14:55:01.000000000 +0100
5@@ -308,6 +308,7 @@
6 
7 static void do_quit(void)
8 {
9+    destroy_hvm_domain();
10     exit(0);
11 }
12 
13Index: ioemu/target-i386-dm/helper2.c
14===================================================================
15--- ioemu.orig/target-i386-dm/helper2.c 2007-05-03 14:55:00.000000000 +0100
16+++ ioemu/target-i386-dm/helper2.c      2007-05-03 14:55:01.000000000 +0100
17@@ -549,5 +549,26 @@
18         /* Wait up to 10 msec. */
19         main_loop_wait(10);
20 
21+    destroy_hvm_domain();
22+
23     return 0;
24 }
25+
26+void destroy_hvm_domain(void)
27+{
28+    int xcHandle;
29+    int sts;
30+
31+    xcHandle = xc_interface_open();
32+    if (xcHandle < 0)
33+        fprintf(logfile, "Cannot acquire xenctrl handle\n");
34+    else {
35+        sts = xc_domain_shutdown(xcHandle, domid, SHUTDOWN_poweroff);
36+        if (sts != 0)
37+            fprintf(logfile, "? xc_domain_shutdown failed to issue poweroff, "
38+                    "sts %d, errno %d\n", sts, errno);
39+        else
40+            fprintf(logfile, "Issued domain %d poweroff\n", domid);
41+        xc_interface_close(xcHandle);
42+    }
43+}
44Index: ioemu/vl.h
45===================================================================
46--- ioemu.orig/vl.h     2007-05-03 14:55:00.000000000 +0100
47+++ ioemu/vl.h  2007-05-03 14:55:01.000000000 +0100
48@@ -1190,4 +1190,7 @@
49 void kqemu_record_dump(void);
50 
51 extern char domain_name[];
52+
53+void destroy_hvm_domain(void);
54+
55 #endif /* VL_H */
Note: See TracBrowser for help on using the repository browser.