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

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

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux