]> git.baikalelectronics.ru Git - kernel.git/commitdiff
xen/manage: Use orderly_reboot() to reboot
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Mon, 27 Jun 2022 14:28:22 +0000 (15:28 +0100)
committerJuergen Gross <jgross@suse.com>
Mon, 1 Aug 2022 05:42:22 +0000 (07:42 +0200)
Currently when the toolstack issues a reboot, it gets translated into a
call to ctrl_alt_del(). But tying reboot to ctrl-alt-del means rebooting
may fail if e.g. the user has masked the ctrl-alt-del.target under
systemd.

A previous attempt to fix this issue made a change that sets the
kernel.ctrl-alt-del sysctl to 1 before ctrl_alt_del() is called.
However, this doesn't give userspace the opportunity to block rebooting
or even do any cleanup or syncing.

Instead, call orderly_reboot() which will call the "reboot" command,
giving userspace the opportunity to block it or perform the usual reboot
process while being independent of the ctrl-alt-del behaviour. It also
matches what happens in the shutdown case.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220627142822.3612106-1-ross.lagerwall@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/manage.c

index 3d5a384d65f7627e3fa9e7f7459ace5ff14cd63b..c16df629907e13d4d4f3ace2ceaa5f8b669afc54 100644 (file)
@@ -205,7 +205,7 @@ static void do_poweroff(void)
 static void do_reboot(void)
 {
        shutting_down = SHUTDOWN_POWEROFF; /* ? */
-       ctrl_alt_del();
+       orderly_reboot();
 }
 
 static struct shutdown_handler shutdown_handlers[] = {