[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/domain: make shutdown state explicit
- To: Mykola Kvach <xakep.amatop@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: "Orzel, Michal" <michal.orzel@xxxxxxx>
- Date: Thu, 19 Mar 2026 11:09:09 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Hfm6QmnRtILbCzalGWpjoEwtNmGG9743U550ZpB9xa8=; b=TFzuAgHXOfB3X80P031G+9Zx9XsZsJrWGtTMFSjQDvckxFzRSNJWKzeRbHRWqLs3Pf+tuRekPz8ayjGCwQdyjNYLmSm5KCUfOI0wfWoA+uYDfNFQzruimMzxDiVMAQ0hEmfAWJZGQaa42Uyis3qJzuAJqSmhVa2nsgLNJA9Q286cue75S3V4RQxh2ibu87oNOEzWW30NIAu4/+5lVh/l9PaI9Sl3sxNS+F+l+j33mT+SfIutvw52SmQg3kHv6gqssjEHnapusQEGa1TNPYjzL0OEZsTq55YAE3A6qnUZcIve5jsrcWUMU+sNrroicWLSzO65GmYHhJqHiEUd8fkG4Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=a7RKThrl7w/ktD+jSYbaFjCUy+XKC3mSYQMOeVbDwJBwjx2oKBtMGjRx4yHTl/CR2RoIuBZatIxoj89v48KediCNSPpztFF3uIlk2xp4RjDXRsa3S+bAu3fkhY6p6erxAcMC8ScXQppwTadCsVWubPLvj91ogXQ+t7j0LuotywX7mm7jqbaUxMD5VvYCarddAfEJjOqin2+Pjv0Jl9MDhw/SRBYH0o6OcGCDui8xjWE4CXr8RF1G8xoQEATJ5oFazMoDC3TLYhHkVAwT3Fp8Yt6PFL2juMEztjcRkjb2O4nuVI4VZbQOwFXrMSS7p+dmAYH5CFxOGN1NyOc1S+Dvtw==
- Cc: Mykola Kvach <mykola_kvach@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>
- Delivery-date: Thu, 19 Mar 2026 10:09:34 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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.
>
> 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
|