lkml.org 
[lkml]   [2006]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 26/35] Add Xen subarch reboot support
From
Date
On Tue, 2006-03-21 at 22:31 -0800, Chris Wright wrote:
> +
> +#ifdef CONFIG_XEN_XENBUS
> +/* Ignore multiple shutdown requests. */
> +static int shutting_down = SHUTDOWN_INVALID;
> +static void __shutdown_handler(void *unused);
> +static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL);
> +#endif
> +
> +#ifdef CONFIG_XEN_XENBUS

eh why the re-ifdef


> +static int shutdown_process(void *__unused)
> +{
> + static char *envp[] = { "HOME=/", "TERM=linux",
> + "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
> + static char *restart_argv[] = { "/sbin/reboot", NULL };
> + static char *poweroff_argv[] = { "/sbin/poweroff", NULL };
> +
> + extern asmlinkage long sys_reboot(int magic1, int magic2,
> + unsigned int cmd, void *arg);
> +
> + daemonize("shutdown");
> +
> + switch (shutting_down) {
> + case SHUTDOWN_POWEROFF:
> + case SHUTDOWN_HALT:
> + if (execve("/sbin/poweroff", poweroff_argv, envp) < 0) {
> + sys_reboot(LINUX_REBOOT_MAGIC1,
> + LINUX_REBOOT_MAGIC2,
> + LINUX_REBOOT_CMD_POWER_OFF,
> + NULL);
> + }
> + break;
> +
> + case SHUTDOWN_REBOOT:
> + if (execve("/sbin/reboot", restart_argv, envp) < 0) {
> + sys_reboot(LINUX_REBOOT_MAGIC1,
> + LINUX_REBOOT_MAGIC2,
> + LINUX_REBOOT_CMD_RESTART,
> + NULL);
> + }
> + break;
> + }
> +
> + shutting_down = SHUTDOWN_INVALID; /* could try again */
> +
> + return 0;
> +}

how is this function different from the generic one? If not, why aren't
you using the generic one?


> +static struct notifier_block xenstore_notifier;

what is this for? It's not exported and hardly used...


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-22 09:43    [W:0.206 / U:2.696 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site