From: Bruno Alvisio Date: Fri, 23 Mar 2018 17:47:52 +0000 (-0700) Subject: Save/Restore Support: Move location of CONFIG_XENBUS macro to include appropiate... X-Git-Tag: xen-RELEASE-4.14.0~9 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=36feb1e548cdc892dc6835367702b49100a842a4;p=people%2Fandrewcoop%2Fmini-os.git Save/Restore Support: Move location of CONFIG_XENBUS macro to include appropiate variables and functions. init_shutdown and fini_shutdown functions should only be implemented if CONFIG_XENBUS is defined. Signed-off-by: Bruno Alvisio Reviewed-by: Juergen Gross Acked-by: Wei Liu --- diff --git a/shutdown.c b/shutdown.c index cd91d07..510f6e1 100644 --- a/shutdown.c +++ b/shutdown.c @@ -48,12 +48,12 @@ 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();