From: Peter Xu <peterx@redhat.com>
To: Fabiano Rosas <farosas@suse.de>
Cc: qemu-devel@nongnu.org, "Juraj Marcin" <jmarcin@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Prasad Pandit" <ppandit@redhat.com>,
"Cédric Le Goater" <clg@redhat.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH 3/5] migration: Notify migration FAILED before starting VM
Date: Mon, 26 Jan 2026 10:21:07 -0500 [thread overview]
Message-ID: <aXeGYwSleEXznWJh@x1.local> (raw)
In-Reply-To: <87sebwgrj7.fsf@suse.de>
On Fri, Jan 23, 2026 at 02:36:28PM -0300, Fabiano Rosas wrote:
> Peter Xu <peterx@redhat.com> writes:
>
> > On Fri, Jan 23, 2026 at 09:59:35AM -0300, Fabiano Rosas wrote:
> >> Peter Xu <peterx@redhat.com> writes:
> >>
> >> > Devices may opt-in migration FAILED notifiers to be invoked when migration
> >> > fails. Currently, the notifications happen in migration_cleanup(). It is
> >> > normally fine, but maybe not ideal if there's dependency of the fallback
> >> > v.s. VM starts.
> >> >
> >> > This patch moves the FAILED notification earlier, so that if the failure
> >> > happened during switchover, it'll notify before VM restart.
> >> >
> >>
> >> The change to FAILED in patch 2 should come to this patch to avoid
> >> having a window where the notification only happens at the end.
> >
> > Hmm.. Isn't that expected? Even after patch 2, we still notify FAILED at
> > the end for precopy. It's the same for postcopy.
> >
>
> Sorry, I meant: s/at the end/after vm_start/.
>
> > For a failed postcopy we have following behavior:
> >
> > Before patch 2
> > ==============
> >
> > - notify FAILED (during switchover)
> > - vm_start()
> > - notify FAILED (during migration_cleanup)
> >
> > After patch 2
> > =============
> >
> > - vm_start()
> > - notify FAILED (during migration_cleanup)
> >
> > So patch 2 fixes the duplicate issue, and only fixes that.
> >
> > After patch 3
> > =============
> >
> > - notify FAILED (during migration_iteration_finish)
> > - vm_start()
> >
> > Patch 3 changes the place of FAILED notification so that it happens always
> > before vm_start(), for both precopy and postcopy.
>
> Right, my point is that with patch 3 we're establishing that the correct
> place to notify is before vm_start().
Yep, likely not strictly correctness in terms of current notifiers, but
since Stefan may have yet another use case that may require a notifier to
be done before vm_start(), it makes more sense for us to move, IMHO.
> But after patch 2, *if* any driver actually depends on being informed of
> failure *before* starting the VM, that will not happen. I think both
> changes could be made at once so that this intermediate state never
> exists.
I see what you meant. I think there should have no such user.
It's because we always notify FAILED at migration_cleanup() for precopy, or
even postcopy before the cpr-exec work (before QEMU 9.0).
That behavior of "notify FAILED before vm_start() for postcopy" is very
specific and only added after commit 4af667f87c ("migration: notifier error
checking"). IOW, before QEMU 9.0, for both precopy and postcopy we always
notify FAILED in migration_cleanup(), never before vm_start().
I mentioned this in the commit log of previous patch too, where I bet the
additional FAILED notification added in 4af667f87c for postcopy path is an
accident (to make it pairing with the "reused DONE", however it turns out
we likely shouldn't do either of them..). So I don't expect anything will
depend on that behavior, and only for postcopy.
The benefit of splitting this patch and previous one is, the previous one
is a "fix" of duplicated notifications, hence if we need a backport that
can be done without this one. Said that, I don't think one should need
it.. It should also make each commits slightly easier to follow, because
they're fundamentally two changes.
Let me know what you think after reading my explanations above. I prefer
the split like as-is, but I can still squash it to close the trivially
small window that you described. I'll make sure if merged the commit
message contains separate discussions on two problems.
--
Peter Xu
next prev parent reply other threads:[~2026-01-26 15:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 23:03 [PATCH 0/5] migration: Notifier fixes for 11.0 Peter Xu
2026-01-22 23:03 ` [PATCH 1/5] migration: Add a tracepoint for invoking migration notifiers Peter Xu
2026-01-23 12:25 ` Fabiano Rosas
2026-01-22 23:03 ` [PATCH 2/5] migration: Fix double notification of DONE/FAIL for postcopy Peter Xu
2026-01-23 12:52 ` Fabiano Rosas
2026-01-23 12:54 ` Fabiano Rosas
2026-01-23 14:58 ` Peter Xu
2026-01-22 23:03 ` [PATCH 3/5] migration: Notify migration FAILED before starting VM Peter Xu
2026-01-23 12:59 ` Fabiano Rosas
2026-01-23 15:40 ` Peter Xu
2026-01-23 17:36 ` Fabiano Rosas
2026-01-26 15:21 ` Peter Xu [this message]
2026-01-26 19:20 ` Fabiano Rosas
2026-01-22 23:03 ` [PATCH 4/5] migration: Drop explicit block activation in postcopy fail path Peter Xu
2026-01-23 12:59 ` Fabiano Rosas
2026-01-22 23:03 ` [PATCH 5/5] migration: Rename MIG_EVENT_PRECOPY_* to MIG_EVENT_* Peter Xu
2026-01-23 13:02 ` Fabiano Rosas
2026-01-26 15:58 ` [PATCH 0/5] migration: Notifier fixes for 11.0 Stefan Hajnoczi
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=aXeGYwSleEXznWJh@x1.local \
--to=peterx@redhat.com \
--cc=clg@redhat.com \
--cc=farosas@suse.de \
--cc=jmarcin@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=ppandit@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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.