From: Peter Xu <peterx@redhat.com>
To: Avihai Horon <avihaih@nvidia.com>
Cc: "Cédric Le Goater" <clg@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Alex Williamson" <alex@shazbot.org>,
"Fabiano Rosas" <farosas@suse.de>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Philippe Mathieu-Daudé" <philmd@mailo.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Jason Herne" <jjherne@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"David Hildenbrand" <david@kernel.org>,
"Eric Farman" <farman@linux.ibm.com>,
"Matthew Rosato" <mjrosato@linux.ibm.com>,
"Cornelia Huck" <cohuck@redhat.com>,
"Eric Blake" <eblake@redhat.com>,
"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
"John Snow" <jsnow@redhat.com>,
"Maor Gottlieb" <maorg@nvidia.com>
Subject: Re: [PATCH v4 07/14] migration: Make switchover-ack re-usable
Date: Mon, 29 Jun 2026 12:27:57 -0400 [thread overview]
Message-ID: <akKdDU7VOmPz-QFT@x1.local> (raw)
In-Reply-To: <64207c96-affd-4895-a6ab-2cee7ac4347e@nvidia.com>
On Mon, Jun 29, 2026 at 06:53:48PM +0300, Avihai Horon wrote:
>
> On 6/29/2026 5:57 PM, Cédric Le Goater wrote:
> > External email: Use caution opening links or attachments
> >
> >
> > Avihai
> >
> > On 6/28/26 18:29, Cédric Le Goater wrote:
> > > On 6/28/26 12:03, Avihai Horon wrote:
> > > >
> > > > On 6/28/2026 12:00 PM, Cédric Le Goater wrote:
> > > > > External email: Use caution opening links or attachments
> > > > >
> > > > >
> > > > > On 6/28/26 10:16, Avihai Horon wrote:
> > > > > >
> > > > > > On 6/26/2026 10:54 AM, Markus Armbruster wrote:
> > > > > > > External email: Use caution opening links or attachments
> > > > > > >
> > > > > > >
> > > > > > > Just spelling nitpickery this time.
> > > > > > >
> > > > > > > Avihai Horon <avihaih@nvidia.com> writes:
> > > > > > >
> > > > > > > > Switchover-ack is a mechanism to synchronize between source and
> > > > > > > > destination QEMU during migration to prevent the
> > > > > > > > source from switching
> > > > > > > > over prematurely.
> > > > > > > >
> > > > > > > > VFIO uses switchover-ack to ensure switchover happens only after
> > > > > > > > destination side has loaded the precopy initial
> > > > > > > > bytes. This is important
> > > > > > > > for VFIO, as otherwise downtime could be impacted and be higher.
> > > > > > > >
> > > > > > > > In its current state, switchover-ack is a
> > > > > > > > one-time mechanism, meaning
> > > > > > > > that switchover is acked only once and past that
> > > > > > > > another ACK cannot be
> > > > > > > > requested again. This was sufficient until now,
> > > > > > > > as VFIO precopy initial
> > > > > > > > bytes was defined to be monotonically
> > > > > > > > decreasing. Thus, when precopy
> > > > > > > > initial bytes reached zero for all VFIO devices,
> > > > > > > > a single ACK would be
> > > > > > > > sent and its validity would hold.
> > > > > > > >
> > > > > > > > However, now the new VFIO_PRECOPY_INFO_REINIT
> > > > > > > > feature allows precopy
> > > > > > > > initial bytes to be re-initialized during precopy. Specifically, it
> > > > > > > > means that initial bytes can grow after reaching zero, which would
> > > > > > > > invalidate a previously sent switchover ACK.
> > > > > > > >
> > > > > > > > To solve this, make switchover-ack reusable and
> > > > > > > > allow devices to request
> > > > > > > > switchover ACKs when needed via the
> > > > > > > > save_query_pending SaveVMHandler.
> > > > > > > >
> > > > > > > > Since now switchover ACK can be requested for a
> > > > > > > > specific device and in
> > > > > > > > different times, make switchover ACK per-device
> > > > > > > > (instead of a single ACK
> > > > > > > > for all devices) and let source side do the
> > > > > > > > pending ACKs accounting.
> > > > > > > >
> > > > > > > > Keep the legacy switchover-ack mechanism for
> > > > > > > > backward compatibility and
> > > > > > > > turn it on by a compatibility property for older
> > > > > > > > machines. Enable the
> > > > > > > > property until VFIO implements the new switchover-ack.
> > > > > > > >
> > > > > > > > Acked-by: Markus Armbruster <armbru@redhat.com>
> > > > > > > > Reviewed-by: Peter Xu <peterx@redhat.com>
> > > > > > > > Signed-off-by: Avihai Horon <avihaih@nvidia.com>
> > > > > > > > ---
> > > > > > > > qapi/migration.json | 14 ++++----
> > > > > > > > include/migration/client-options.h | 1 +
> > > > > > > > include/migration/register.h | 2 ++
> > > > > > > > migration/migration.h | 32 ++++++++++++++++--
> > > > > > > > migration/savevm.h | 6 ++--
> > > > > > > > migration/migration.c | 37 ++++++++++++++-------
> > > > > > > > migration/options.c | 10 ++++++
> > > > > > > > migration/savevm.c | 53
> > > > > > > > +++++++++++++++++++++++-------
> > > > > > > > migration/trace-events | 5 +--
> > > > > > > > 9 files changed, 123 insertions(+), 37 deletions(-)
> > > > > > > >
> > > > > > > > diff --git a/qapi/migration.json b/qapi/migration.json
> > > > > > > > index 27a7970556..9b3070e494 100644
> > > > > > > > --- a/qapi/migration.json
> > > > > > > > +++ b/qapi/migration.json
> > > > > > > > @@ -508,14 +508,12 @@
> > > > > > > > # (since 7.1)
> > > > > > > > #
> > > > > > > > # @switchover-ack: If enabled, migration will
> > > > > > > > not stop the source VM
> > > > > > > > -# and complete the migration until an ACK is received from the
> > > > > > > > -# destination that it's OK to do so. Exactly when this ACK is
> > > > > > > > -# sent depends on the migrated devices that
> > > > > > > > use this feature. For
> > > > > > > > -# example, a device can use it to make sure
> > > > > > > > some of its data is
> > > > > > > > -# sent and loaded in the destination before doing switchover.
> > > > > > > Here, "switchover" is used as noun. My dictionary
> > > > > > > is happy with that.
> > > > > > >
> > > > > > > > -# This can reduce downtime if devices that
> > > > > > > > support this capability
> > > > > > > > -# are present. 'return-path' capability
> > > > > > > > must be enabled to use
> > > > > > > > -# it. (since 8.1)
> > > > > > > > +# and complete the migration until the destination has
> > > > > > > > +# acknowledged that it is OK to
> > > > > > > > switchover. The acknowledgement
> > > > > > >
> > > > > > > Here, it's used as verb. I think it needs to be spelled "to switch
> > > > > > > over".
> > > > > > >
> > > > > > > Same for code comments etc.
> > > > > >
> > > > > > Sure, I can send a patch to fix those.
> > > > >
> > > > > Can you please send the update as a follow up patch ?
> > > >
> > > > I was planning to send it along with the bool return value
> > > > refactor in patch #1. Would that be fine?
> > >
> > > OK. Nothing merged yet. Let's have a v5.
> >
> > FYI, I plan to send vfio-next before the end the week. Initial plan was
> > tomorrow.
>
> Hi Cedric,
>
> Actually, I have plenty of things on my plate right now and I'm not sure if
> I'll be able to send it this week.
>
> Would it be OK if you merge the series as is and I send those two patches
> separately early next week?
> (They are actually more related to migration core, so this question should
> be addressed to Peter/Fabiano I guess...)
I'm OK either way.
The simplest to me is you can provide a small fixup for Cédric to pick up
and squash into this patch (if it's only wording changes to doc and
comments, IMHO no re-test needed), as long as Cédric is comfortable with
it, then you can send a separate patch (or patches) if that'll be on
migration.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2026-06-29 16:28 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 10:12 [PATCH v4 00/14] Make switchover-ack re-usable and add VFIO precopy REINIT feature Avihai Horon
2026-06-22 10:12 ` [PATCH v4 01/14] migration: Propagate errors in migration_completion_precopy() Avihai Horon
2026-06-24 7:15 ` Cédric Le Goater
2026-06-22 10:12 ` [PATCH v4 02/14] migration/ram: Use migration_bitmap_sync_precopy() for postcopy discard Avihai Horon
2026-06-22 10:12 ` [PATCH v4 03/14] migration: Run final save_query_pending at switchover Avihai Horon
2026-06-22 11:37 ` Jason J. Herne
2026-06-22 10:12 ` [PATCH v4 04/14] migration: Log the approver in qemu_loadvm_approve_switchover() Avihai Horon
2026-06-22 10:12 ` [PATCH v4 05/14] migration: Replace switchover_ack_needed SaveVMHandler Avihai Horon
2026-06-22 10:12 ` [PATCH v4 06/14] migration: Rename switchover-ack code to legacy Avihai Horon
2026-06-22 10:12 ` [PATCH v4 07/14] migration: Make switchover-ack re-usable Avihai Horon
2026-06-26 7:54 ` Markus Armbruster
2026-06-28 8:16 ` Avihai Horon
2026-06-28 9:00 ` Cédric Le Goater
2026-06-28 10:03 ` Avihai Horon
2026-06-28 16:29 ` Cédric Le Goater
2026-06-29 14:57 ` Cédric Le Goater
2026-06-29 15:53 ` Avihai Horon
2026-06-29 16:27 ` Cédric Le Goater
2026-06-29 16:27 ` Peter Xu [this message]
2026-06-29 20:51 ` Avihai Horon
2026-06-22 10:12 ` [PATCH v4 08/14] migration: Fail migration if switchover-ack is requested after switchover decision Avihai Horon
2026-06-22 10:12 ` [PATCH v4 09/14] vfio/migration: Extract VFIO_MIG_FLAG_DEV_INIT_DATA_SENT sending to helper Avihai Horon
2026-06-22 10:12 ` [PATCH v4 10/14] vfio/migration: Add Error ** parameter to vfio_migration_init() Avihai Horon
2026-06-22 10:12 ` [PATCH v4 11/14] vfio/migration: Add new switchover-ack mechanism Avihai Horon
2026-06-22 10:12 ` [PATCH v4 12/14] vfio/migration: Implement VFIO_PRECOPY_INFO_REINIT feature Avihai Horon
2026-06-22 10:12 ` [PATCH v4 13/14] vfio/migration: Check VFIO_PRECOPY_INFO_REINIT during switchover Avihai Horon
2026-06-22 10:12 ` [PATCH v4 14/14] migration: Enable new switchover-ack Avihai Horon
2026-06-24 7:16 ` Cédric Le Goater
2026-06-26 18:44 ` [PATCH v4 00/14] Make switchover-ack re-usable and add VFIO precopy REINIT feature Cédric Le Goater
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=akKdDU7VOmPz-QFT@x1.local \
--to=peterx@redhat.com \
--cc=alex@shazbot.org \
--cc=armbru@redhat.com \
--cc=avihaih@nvidia.com \
--cc=borntraeger@linux.ibm.com \
--cc=clg@redhat.com \
--cc=cohuck@redhat.com \
--cc=david@kernel.org \
--cc=eblake@redhat.com \
--cc=farman@linux.ibm.com \
--cc=farosas@suse.de \
--cc=iii@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=jsnow@redhat.com \
--cc=maorg@nvidia.com \
--cc=mjrosato@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=philmd@mailo.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=vsementsov@yandex-team.ru \
--cc=zhao1.liu@intel.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.