All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Xu <peterx@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>
Cc: Juraj Marcin <jmarcin@redhat.com>,
	qemu-devel@nongnu.org, Fabiano Rosas <farosas@suse.de>,
	qemu-stable@nongnu.org
Subject: Re: [PATCH] migration: Fix state transition in postcopy_start() error handling
Date: Mon, 29 Sep 2025 11:47:26 -0400	[thread overview]
Message-ID: <aNqqDlMKhT1j8i2-@x1.local> (raw)
In-Reply-To: <f030f57c-fc09-476d-a767-75857f7d864f@tls.msk.ru>

On Sat, Sep 27, 2025 at 05:01:11PM +0300, Michael Tokarev wrote:
> On 26.08.2025 14:51, Juraj Marcin wrote:
> > From: Juraj Marcin <jmarcin@redhat.com>
> > 
> > Commit 48814111366b ("migration: Always set DEVICE state") introduced
> > DEVICE state to postcopy, which moved the actual state transition that
> > leads to POSTCOPY_ACTIVE.
> > 
> > However, the error handling part of the postcopy_start() function still
> > expects the state POSTCOPY_ACTIVE, but depending on where an error
> > happens, now the state can be either ACTIVE, DEVICE or CANCELLING, but
> > never POSTCOPY_ACTIVE, as this transition now happens just before a
> > successful return from the function.
> > 
> > Instead, accept any state except CANCELLING when transitioning to FAILED
> > state.
> > 
> > Cc: qemu-stable@nongnu.org
> > Fixes: 48814111366b ("migration: Always set DEVICE state")
> > Signed-off-by: Juraj Marcin <jmarcin@redhat.com>
> > 
> > ---
> > In the RFC[1] where this patch was discussed, there was also a
> > suggestion for a helper function migrate_set_failure() that would check
> > if the state is not CANCELLING and then set migration error and FAILED
> > state. I discussed the implementation with Peter, and we came to a
> > conclusion that instead of patching such clean-up on top of the current
> > error handling code, it might be more useful to do a larger refactor and
> > clean-up of all error handling in the migration code.
> > 
> > Such clean-up should reduce the number of places where we need to
> > explicitly transition to a FAILED state (ideally to one, or only a
> > couple of places), and instead only set an appropriate migration error
> > using migrate_set_error(). Additionally, it would also refactor
> > inappropriate uses of QEMUFile errors where the error is not really an
> > error of the underlying channel and migrate_set_error() should be used
> > instead.
> > 
> > [1]: https://lore.kernel.org/all/20250807114922.1013286-3-jmarcin@redhat.com/
> 
> Ping?  Can we apply this to the master branch, so I can pick it up for
> the stable series?

Apologies for the delay, queued.  Will send the PR this week.

-- 
Peter Xu



      reply	other threads:[~2025-09-29 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-26 11:51 [PATCH] migration: Fix state transition in postcopy_start() error handling Juraj Marcin
2025-08-26 18:23 ` Peter Xu
2025-08-26 19:00   ` Fabiano Rosas
2025-09-27 14:01 ` Michael Tokarev
2025-09-29 15:47   ` Peter Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aNqqDlMKhT1j8i2-@x1.local \
    --to=peterx@redhat.com \
    --cc=farosas@suse.de \
    --cc=jmarcin@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.