]> xenbits.xensource.com Git - mini-os.git/commitdiff
Save/Restore Support: Move location of CONFIG_XENBUS macro to include appropiate...
authorBruno Alvisio <bruno.alvisio@gmail.com>
Fri, 23 Mar 2018 17:47:52 +0000 (10:47 -0700)
committerWei Liu <wei.liu2@citrix.com>
Tue, 27 Mar 2018 11:23:30 +0000 (12:23 +0100)
init_shutdown and fini_shutdown functions should only be implemented if
CONFIG_XENBUS is defined.

Signed-off-by: Bruno Alvisio <bruno.alvisio@gmail.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
shutdown.c

index cd91d0769ab260bd4f1e1b211e8fbd1be7e209c5..510f6e18761af5ccfe6c2b849a930da931c64b7c 100644 (file)
 
 static start_info_t *start_info_ptr;
 
+#ifdef CONFIG_XENBUS
 static const char *path = "control/shutdown";
 static const char *token = "control/shutdown";
 static xenbus_event_queue events = NULL;
 static int end_shutdown_thread = 0;
 
-#ifdef CONFIG_XENBUS
 /* This should be overridden by the application we are linked against. */
 __attribute__((weak)) void app_shutdown(unsigned reason)
 {
@@ -110,7 +110,6 @@ static void shutdown_thread(void *p)
         app_shutdown(shutdown_reason);
     }
 }
-#endif
 
 static void fini_shutdown(void)
 {
@@ -132,6 +131,7 @@ void init_shutdown(start_info_t *si)
     end_shutdown_thread = 0;
     create_thread("shutdown", shutdown_thread, NULL);
 }
+#endif
 
 void kernel_shutdown(int reason)
 {
@@ -154,7 +154,9 @@ void kernel_shutdown(int reason)
 
     printk("MiniOS will shutdown (reason = %s) ...\n", reason_str);
 
+#ifdef CONFIG_XENBUS
     fini_shutdown();
+#endif
 
     stop_kernel();