]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
xen: make destroy_hvm_domain static
authorIan Campbell <ian.campbell@citrix.com>
Thu, 28 Jan 2016 14:43:53 +0000 (14:43 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Feb 2016 16:16:42 +0000 (16:16 +0000)
which involves moving it higher up in the file to before its sole user
(cpu_handle_ioreq). Apart from inserting the word "static" and
removing the prototype in the header this is pure code motion.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
include/hw/xen/xen_common.h
xen-hvm.c

index ab7046ccc39a0f4a8e8141b1f5eef537d91545a0..38502c752d08b79580c7eba18ac51824bc468f42 100644 (file)
@@ -76,8 +76,6 @@ static inline void *xenforeignmemory_map(xc_interface *h, uint32_t dom,
 
 #endif
 
-void destroy_hvm_domain(bool reboot);
-
 /* shutdown/destroy current domain because of an error */
 void xen_shutdown_fatal_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
index 73eef0cb37afdea158dd7a0171497a3d4cf0354c..d9b57f70d59eb03d8cb91d8b6bf85e3f1c64f779 100644 (file)
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -1025,6 +1025,29 @@ static void handle_buffered_io(void *opaque)
     }
 }
 
+static void destroy_hvm_domain(bool reboot)
+{
+    xc_interface *xc_handle;
+    int sts;
+
+    xc_handle = xc_interface_open(0, 0, 0);
+    if (xc_handle == NULL) {
+        fprintf(stderr, "Cannot acquire xenctrl handle\n");
+    } else {
+        sts = xc_domain_shutdown(xc_handle, xen_domid,
+                                 reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff);
+        if (sts != 0) {
+            fprintf(stderr, "xc_domain_shutdown failed to issue %s, "
+                    "sts %d, %s\n", reboot ? "reboot" : "poweroff",
+                    sts, strerror(errno));
+        } else {
+            fprintf(stderr, "Issued domain %d %s\n", xen_domid,
+                    reboot ? "reboot" : "poweroff");
+        }
+        xc_interface_close(xc_handle);
+    }
+}
+
 static void cpu_handle_ioreq(void *opaque)
 {
     XenIOState *state = opaque;
@@ -1353,29 +1376,6 @@ err:
     exit(1);
 }
 
-void destroy_hvm_domain(bool reboot)
-{
-    xc_interface *xc_handle;
-    int sts;
-
-    xc_handle = xc_interface_open(0, 0, 0);
-    if (xc_handle == NULL) {
-        fprintf(stderr, "Cannot acquire xenctrl handle\n");
-    } else {
-        sts = xc_domain_shutdown(xc_handle, xen_domid,
-                                 reboot ? SHUTDOWN_reboot : SHUTDOWN_poweroff);
-        if (sts != 0) {
-            fprintf(stderr, "xc_domain_shutdown failed to issue %s, "
-                    "sts %d, %s\n", reboot ? "reboot" : "poweroff",
-                    sts, strerror(errno));
-        } else {
-            fprintf(stderr, "Issued domain %d %s\n", xen_domid,
-                    reboot ? "reboot" : "poweroff");
-        }
-        xc_interface_close(xc_handle);
-    }
-}
-
 void xen_register_framebuffer(MemoryRegion *mr)
 {
     framebuffer = mr;