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

[PATCH] xen/manage: Use orderly_reboot() to reboot


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Mon, 27 Jun 2022 15:28:22 +0100
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Oleksandr Tyshchenko" <oleksandr_tyshchenko@xxxxxxxx>, Dongli Zhang <dongli.zhang@xxxxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Delivery-date: Mon, 27 Jun 2022 14:29:41 +0000
  • Ironport-data: A9a23:B+rK7a5iNjcBtE950fu0uAxRtAnHchMFZxGqfqrLsTDasY5as4F+v jcZX2vSbq6MajP0KdwkPYS2oENSv8TTzN5mGwVkqnhnHi5G8cbLO4+Ufxz6V8+wwmwvb67FA +E2MISowBUcFyeEzvuVGuG96yE6j8lkf5KkYAL+EnkZqTRMFWFw03qPp8Zj2tQy2YbjXFvU0 T/Pi5a31GGNimYc3l08s8pvmDs31BglkGpF1rCWTakjUG72zxH5PrpGTU2CByKQrr1vNvy7X 47+IISRpQs1yfuP5uSNyd4XemVSKlLb0JPnZnB+A8BOiTAazsA+PzpS2FPxpi67hh3Q9+2dx umhurStDicPEoPzst5HSgNHFHllOLNq2JnYdC3XXcy7lyUqclPpyvRqSko3IZcZ6qB8BmQmG f4wcW5XKErZ3qTvnez9GrIEascLdaEHOKsFvWp7izXQAvs8XpnHR43B5MNC3Sd2jcdLdRrbT 5VFMmY2Nk6bC/FJEkgREq9vzMb1umjUazJjoUOkgZYu7FGGmWSd15CyaYGIK7RmX/59mUKVp XnP+WjjNQ0LL9yUyTeD8XWEi/fGmGXwX4d6PLG/8PFugRuBxmUVBzURT1KwpfT/gUm7M/pVL FYV4WwptrQo81KwTcjVWAexq3qJ+BUbXrJ4A+A8rQ2A1KfQywKYHXQfCC5MbsQ8s807TiBs0 UWG9/vrCiZoq6a9Um+G+/GfqjbaETMOMWYIaCsATA0Ey9ruuoc+ilTIVNkLLUKupoSrQ3eqm WnM9XVgweVI5SIW60ml1U2AoxSAiKfjdFQs/BrQBnmg8C9ZQpHwMuRE9mPnAeZ8wJexFwfc4 iBfxpDBvIjiHrnWynXTHbxl8KWBoq/cbWaC2QMH84wJrWzFxpK1QWxHDNiSzm9NO91MRzLma VS7Veh5tM4KZyvCgUOajuuM5yUWIUvIT42Nugj8NIYmX3SIXFbvENtSTUCRxXvxt0MnjLsyP 5yWGe71UytEU/o3kWvoHr9HuVPO+szZ7TqLLa0XMjz9iebODJJrYext3KSyghARs/rf/VS9H yd3PMqW0RRPONDDjt3s2ddLdzgidCFjbbiv8pw/XrPSeWJORTB+Y8I9NJt8IuSJaYwOzreWl px8M2cFoGfCaYrvc1XSMC85M+OzB/6SbxsTZEQRALph4FB7Ca7H0UvVX8FtFVX73ISPFcJJc sQ=
  • Ironport-hdrordr: A9a23:JgFGkaN7oMRkusBcTs+jsMiBIKoaSvp037Eqv3oRdfUzSL3+qy nOpoVj6faaskdzZJhNo7+90cq7MBfhHPxOkOss1N6ZNWGM0gbFEGgL1/qF/9SKIU3DH4Bmu5 uIC5IObeHNMQ==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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 set the flag to force rebooting when
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@xxxxxxxxxx>
---
 drivers/xen/manage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
index 3d5a384d65f7..c16df629907e 100644
--- a/drivers/xen/manage.c
+++ b/drivers/xen/manage.c
@@ -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[] = {
-- 
2.31.1




 


Rackspace

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