WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [RFC PATCH 26/35] Add Xen subarch reboot support

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...



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>