xen/manage: enable C_A_D to force reboot
PATCH 1/1 xen/manage: enable C_A_D to force reboot
The systemd may be configured to mask ctrl-alt-del via "systemctl mask ctrl-alt-del.target". As a result, the pv reboot would not work as signal is ignored.
This patch always enables C_A_D before the call of ctrl_alt_del() in order to force the reboot.
--- drivers/xen/manage.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/xen/manage.c +7 -0
@@ -204,6 +204,13 @@ static void do_poweroff(void)static void do_reboot (void ) { shutting_down =SHUTDOWN_POWEROFF ;/* ? */ +/* +* The systemd may be configured to mask ctrl-alt-del via +* "systemctl mask ctrl-alt-del.target". As a result, the pv reboot +* would not work. To enable C_A_D would force the reboot. +*/ +C_A_D =1 ; +ctrl_alt_del (); }
Signature · 1 line
2.17.1
Jürgen Groß
maintainerQuoted 6 lines · Dongli Zhang
The systemd may be configured to mask ctrl-alt-del via "systemctl mask ctrl-alt-del.target". As a result, the pv reboot would not work as signal is ignored.
This patch always enables
C_A_Dbefore the call ofctrl_alt_del()in order to force the reboot.
Hmm, I'm not sure this is a good idea.
Suppose a guest admin is doing a critical update and wants to avoid a sudden reboot in between. By masking the reboot this would be possible, with your patch it isn't.
In case a reboot is really mandatory it would still be possible to just kill the guest.
I'm not completely opposed to the patch, but I think this is a change which should not be done easily.
Juergen
Quoted 28 lines
Reported-by Rose Wang <[email protected]>Cc Joe Jin <[email protected]>Cc Boris Ostrovsky <[email protected]>Signed-off-by Dongli Zhang <[email protected]>--- drivers/xen/manage.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/xen/manage.c +7
-0@@ -204,6 +204,13 @@ static void do_poweroff(void)static void do_reboot (void ) { shutting_down =SHUTDOWN_POWEROFF ;/* ? */ +/* +* The systemd may be configured to mask ctrl-alt-del via +* "systemctl mask ctrl-alt-del.target". As a result, the pv reboot +* would not work. To enable C_A_D would force the reboot. +*/ +C_A_D =1 ; +ctrl_alt_del (); }
Quoted 16 lines · Jürgen Groß
Quoted 8 lines · Dongli Zhang
The systemd may be configured to mask ctrl-alt-del via "systemctl mask ctrl-alt-del.target". As a result, the pv reboot would not work as signal
is ignored.This patch always enables
C_A_Dbefore the call ofctrl_alt_del()in order
to force the reboot.Hmm, I'm not sure this is a good idea.
Suppose a guest admin is doing a critical update and wants to avoid a sudden reboot in between. By masking the reboot this would be possible, with your patch it isn't.
Quoted 5 lines
In case a reboot is really mandatory it would still be possible to just kill the guest.
I'm not completely opposed to the patch, but I think this is a change which should not be done easily.
I think 'xl reboot -F' should do be handling this scenario but (1) it is currently not quite set up for this and (2) I can't see how it works at all given that noone handles LIBXL_TRIGGER_RESET in arch_do_domctl(XEN_DOMCTL_sendtrigger).
-boris
Quoted 32 lines
Juergen
Quoted 27 lines
Reported-by Rose Wang <[email protected]>Cc Joe Jin <[email protected]>Cc Boris Ostrovsky <[email protected]>Signed-off-by Dongli Zhang <[email protected]>---
drivers/xen/manage.c| 7 +++++++1 file changed, 7 insertions(+)drivers/xen/manage.c +0
-0@@ -204,6 +204,13 @@ static void do_poweroff(void) static void do_reboot(void) {
shutting_down=SHUTDOWN_POWEROFF; /* ? */
+ /*
+ * The systemd may be configured to mask ctrl-alt-del via + * "systemctl mask ctrl-alt-del.target". As a result, the pv reboot + * would not work. To enableC_A_Dwould force the reboot. + */
+C_A_D= 1;
+
ctrl_alt_del();
}