[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/manage: Use orderly_reboot() to reboot
- To: Juergen Gross <jgross@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
- Date: Mon, 27 Jun 2022 15:29:55 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1z7Wy4bj5krUpA7LosAUE0/1btvlK4cd9rZX5jjNJ4Y=; b=Cp80QgnGTpkd36JWFVnvEttjXsd7RlpczgOVQ0uShA6LPjtDK1Z7nwlYYbtibO046MYqgiZ3u4MOoipcXBNXZ2v+RN8M+jl/rd+U+TTxYZPG1WtYvK6zCGepr/KKZfotmCMMXySp3sWNpEBgExTyR65QIBtLSgJEDFLq2IUkSIle2dc1gUyZ0F3RsX/a7Qv15Wq/Wf7KWbiQfyZ4kwuTyZpR4wf3Dl9n7VDDzOiLZ3i66wCaW/gdhrFVu6JbVZItZrWcIR42WhDVjp4bJEcC6Gc2zVIXrCYKeIDW72d+L3/pgU4sqOh/Gqev2dlJbnENCHwy1bRdEelfkyjb7kwH3g==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MhrDtcYVhzRyCMtbMK9fVFCGoxWpAt5LQzDX7JRnFYzCy7LYtszyxH6owgsPkP9NA1SpeGP/JCn6wGLP7ySr48jUUUXwBQdvnsbwgg8v3L50KJbvX4C3Boyu7BLhCXX1ok8Eog62kPr3qAOXYkTv1N3Xe4sgJpWtwSDKACixuswkzjHLnrXL2pvN1+GgrmHaDNAZT0RzdcRTDTmfMX1MoxlStZpSBvVnhcws42ADPkryJXsdMsUTVA4dcZZXgcjU4Rwb7V+4Qu8mBdEYQF5Ul5yKoqq6H6ldduaU5m4fgtwvRgIiPTmjz+hsYMWPspCzEv+nxdGAkwmzKrTXTKrA8Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: 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 15:30:11 +0000
- Ironport-data: A9a23:rMC77Kj/np0rh+jMJU3v88GyX161sREKZh0ujC45NGQN5FlHY01je htvXTyHOP+CZGrzKNF2PNjk8htQvpTXytIxTgpqrCE3Rikb9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M58wIFqtQw24LhXVnS4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YSwIZY39tsYXaSZdAQN1PfAFpJqEA2fq5KR/z2WeG5ft69NHKRhueKgnoKNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuIIehW9p7ixNNa+2i 84xcz10d1LEahJCIEgeDJYWl+a0nHjvNTZfrTp5oIJovzmIl1cqjNABNvKJe/vRZIZ2hHyEm U7Y2WvHDwoeGYamnG/tHnWEw7WncTnAcIAdDrqj7dZxnUaegGcUDXU+RVa95PW0lEO6c9ZeM FAPvDojq7Ao806mRcW7WAe3yFafpQIVUddUF+w86SmOx7DS7gLfAXILJhZGbNElr8YwSSYdy k6Sn9jpCDpst5WYUXuYsLyTqFuaNS8TImsDIz0ERA0Ky975qYo3g1TESdMLOKSylNzuXzbr3 yqNsjM9lp0Ul8cA06j99lfC6w9AvbDMRw8xowDIBGSs61ohYJb/PtTxr1/G8fxHMYCVCEGbu 2QJkNSf6+ZICoyRkCuKQ6MGG7TBC+u5DQAwSGVHR/EJnwlBMVb6FWyMyFmS/HtUD/s=
- Ironport-hdrordr: A9a23:IgcJpaH7A4TEEMSHpLqFWJHXdLJyesId70hD6qkvc3Fom52j/f xGws5x6fatskdpZJkh8erwW5VoMkmsjaKdhrNhdotKPTOW8FdASbsP0WKM+UyGJ8STzI9gPM RbAuJD4b/LfD5HZK/BiWHWferIq+P3kpxA8N2uq0uFOjsaDp2IgT0YNi+rVmlNACVWD5swE5 SRouBdoSC7RHgRZsOnQlEYQunqvbTw5d7bSC9DIyRixBiFjDuu5rK/OQOfxA0iXzRGxqpn2X TZkjb++r6ov5iAu1DhPi7ontprcenau5t+7f+3+4sow/LX+0SVjbFaKvy/VfYO0aSSARgR4Z 3xSlwbTr9OAjvqDxuISF3WqkTdOX8VmgPfIVP0uwqfneXpAD09EMZPnoRfb1/Q7Fchpsh11O ZR03uerIc/N2K2oM3R3am8a/hRrDvBnVMy1eoIy3BPW4oXb7Fc6YQZ4UNOCZ8FWCb38pouHu ViBNzVoK8+SyLSU1nJ+m10hNC8VHU6GRmLBkAEp8yOyjBT2HR01VERysATlmoJsJg9V55H7e LZNbkArsA5cuYGKaZmQOsRS8q+DWLABRrKLWKJOFziULoKPnrcwqSHkondJNvaC6Dg4KFC5q gpCmkoylLaU3ieePGmzdlM7g3HRnm7UHDk1txejqIJyoHBeA==
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Msip_labels:
- Thread-index: AQHYijk2RX7/puuRFEiy7ev5zhwyTw==
- Thread-topic: [PATCH] xen/manage: Use orderly_reboot() to reboot
> From: Juergen Gross
> Sent: Monday, June 27, 2022 3:49 PM
> To: Ross Lagerwall; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Stefano Stabellini; Oleksandr Tyshchenko; Dongli Zhang; Boris Ostrovsky
> Subject: Re: [PATCH] xen/manage: Use orderly_reboot() to reboot
>
>
> On 27.06.22 16:28, Ross Lagerwall wrote:
> > 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.
>
> Sorry, I have problems parsing this sentence.
Probably because it is poorly worded... How about this?
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@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[] = {
>
> The code seems to be fine.
>
> Albeit I wonder whether we shouldn't turn shutting_down into a bool,
> as all that seems to be needed is "shutting_down != SHUTDOWN_INVALID"
> today. But this could be part of another patch.
>
Agreed that shutting_down could be a bool but better to change it
in a separate patch.
Thanks,
Ross
|