|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/domain: make shutdown state explicit
Hi Michal, Thank you for the review. On Thu, Mar 19, 2026 at 12:09 PM Orzel, Michal <michal.orzel@xxxxxxx> wrote: > > > > On 19/03/2026 00:25, Mykola Kvach wrote: > > From: Mykola Kvach <mykola_kvach@xxxxxxxx> > > > > The domain shutdown flow currently overloads is_shutting_down and > > is_shut_down to represent multiple phases of the shutdown lifecycle, > > while some users treat is_shutting_down as a broader "domain is no > > longer normal" condition. > > > > Make the shutdown lifecycle explicit by introducing > > enum domain_shutdown_state and converting the existing users to helper > > predicates describing whether shutdown is in progress, complete, or > > active. > > > > At the same time, make domain_resume() validate its input state and > > return an error to its callers. Resume is now accepted only from the > > fully shut down state. > Also, you limit it now to SHUTDOWN_suspend or SHUTDOWN_soft_reset. Ideally you > should explain why i.e. resuming from crash/poweroff/reboot is semantically > meaningless. That makes sense. Looking at the existing flow more closely, the suspend and soft-reset cases are not symmetric. For suspend, the intended semantics are explicit and long-standing: the public SCHEDOP_shutdown documentation describes special resume semantics only for SHUTDOWN_suspend, libxl documents resume for a suspended domain, and xc_domain_resume has long rejected domains which are not shut down with SHUTDOWN_suspend. Soft reset is different. The toolstack may choose soft-reset as the action for other shutdown reasons too, e.g. on_reboot=soft-reset. In that case the domain reaches the soft-reset path with shutdown_code still set to SHUTDOWN_reboot, and only afterwards the toolstack decides to perform a soft reset. So the new validation in domain_resume() is too strict for the existing soft-reset flow. Given that, I agree the checks should not be there in the current form. I'll drop the checks in the next version. Best regards, Mykola > > > > > This removes the implicit coupling between unrelated users of > > is_shutting_down and makes the shutdown/resume state transitions > > self-describing. > > > > Suggested-by: Jan Beulich <jbeulich@xxxxxxxx> > > Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx> > This is mostly a mechanical change. I verified that correct helpers are used > in > place of old flags. > Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx> > > ~Michal >
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |