[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



On Wednesday 22 March 2006 07:31, Chris Wright wrote:
> +       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 };

It would be better if that was user configurable.

> +     extern asmlinkage long sys_reboot(int magic1, int magic2,
> +                                       unsigned int cmd, void *arg);

This is what linux/syscalls.h is there for.



> +     daemonize("shutdown");

What is that good for?

> +
> +     switch (shutting_down) {
> +     case SHUTDOWN_POWEROFF:
> +     case SHUTDOWN_HALT:
> +             if (execve("/sbin/poweroff", poweroff_argv, envp) < 0) {

You should probably keep track if the execve already happened and if it is 
called
again do the sys_reboot directly.


-Andi

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.