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

Re: [RFC PATCH] xen: handle domain_shutdown() return values


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Mykola Kvach <xakep.amatop@xxxxxxxxx>
  • Date: Thu, 19 Mar 2026 16:35:22 +0200
  • Arc-authentication-results: i=1; mx.google.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZISoUCzIjE59H/rnhW5DHgGID5AZAfvPV/PaJgYMi3M=; fh=8JQmPggC+L5NdWbfpQ6+1DbzndGImN/O2adNKUkU4d8=; b=eg9arQJqLM1Rtc/0g9uHo8HVK7GCXDn6yx/422WY9SELXqau4xXZswG2T/FT9lubm9 pE0X6X837YQpnuR8xR3aPzhd3OMdCgzGzoyEiyk4QR0pS+wswJsSHDEdE6gLnGEVPAUV PyrlJ5Eg9neolGw+TiT8Dx/rv8drwB6PH9A2QRETe8xBrlT2oG6OlB5I+EXYFavtSVj7 BidEIAo65lIdoWnYRPQQZC+WHsC+Z8Z16xX+JPttCQ9bG8KKdncDl9NHZ1qm/mIohIlm VpISDf/i0tXcmz/cKvBdqrMtwvU0Y2bp1L7Zr1q47TaNV5cdkNsp/sPxIK+mNlyM9alc CRPA==; darn=lists.xenproject.org
  • Arc-seal: i=1; a=rsa-sha256; t=1773930936; cv=none; d=google.com; s=arc-20240605; b=Js1cUsakSMaBM3dS/qhDZ3We2wIWsn3J/dNYBffPIOIY/j+HVWFqjrW9qlYG6vVV+9 xpFenzGZ2w9Far99Ph27Sw+o0vAdbUuwx4ZkTrrtZS41zpno3IWQDP0o7zsTaNGcKh5+ 8fLRNPWAYaTZZBpmnTmttJd/wx9wjqzkLWF84GmB5DVt7LLvo7bWyxI1P0txt7F/GDKs npmHxSX2pdyE5HlSCUcT654+akVHCJ877MW49AlIFe2iAlZPcp0GZQLHk2KcpcyXG4ni N+zxt8KZblslaiXMfrqEjBa0QYCUrKDyjPnVxGUw7mA7BRDdHqCfc/CDAn19gg8XXKXd L2IQ==
  • Cc: Mykola Kvach <mykola_kvach@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 19 Mar 2026 14:35:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jan,

Thank you for the review.

On Thu, Mar 19, 2026 at 3:44 PM Jan Beulich <jbeulich@xxxxxxxx> wrote:
>
> On 19.03.2026 13:42, Mykola Kvach wrote:
> > From: Mykola Kvach <mykola_kvach@xxxxxxxx>
> >
> > Propagate domain_shutdown() return codes through the shutdown paths
> > which can still report errors to their callers, and log explicit
> > failures in fire-and-forget paths instead of silently discarding the
> > result.
> >
> > This makes the shutdown contract explicit for callers which can report
> > errors, while preserving observable diagnostics for the remaining
> > fire-and-forget paths.
> >
> > It also fixes MISRA Dir 4.7 and Rule 17.7 violations by ensuring that
> > the returned status is tested or otherwise used.
> >
> > Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
>
> I don't agree with this. For what you want to do (as per the link below)
> this is a prereq, but as an independent change I'm not convinced this is
> needed. Once it is grouped with that other change, it's kind of natural,
> and hence any Suggested-by: would feel odd.

I see your point, but I'd still prefer to keep this as a standalone change.

It is no longer tied to the suspend/resume work, as the changes adding new
error cases there are gone. What remains is making the existing non-void
domain_shutdown() contract explicit at its call sites.

So from my perspective this patch stands on its own for two reasons:
- it fixes MISRA Dir 4.7 and Rule 17.7 issues by ensuring the returned status
  is tested or propagated;
- it avoids leaving latent bugs behind if domain_shutdown() gains additional
  failure cases in the future, beyond the currently relevant ones.

>
> I'm further unconvinced logging is the right course of action in all of
> the cases. Some may want to be assertions instead?

That said, I agree the handling likely shouldn't be uniform across all
callers. I can revisit the fire-and-forget paths and use assertions where
a non-zero return should be impossible, instead of logging unconditionally.

If I understand you correctly, then without any additional
suspend-related error case being introduced, you don't see enough
value in this as a standalone patch. Is that the right reading?

Best regards,
Mykola

>
> Jan
>
> > Signed-off-by: Mykola Kvach <mykola_kvach@xxxxxxxx>
> > ---
> > Link to discussion: 
> > https://patchew.org/Xen/cover.1748848482.git.mykola._5Fkvach@xxxxxxxx/7bd75ecfff5b0a75ea5abd7cc4934582d7e1250c.1748848482.git.mykola._5Fkvach@xxxxxxxx/#90048f71-8313-4110-924c-f956a2bec5a0@xxxxxxxx



 


Rackspace

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