public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Eugenio Perez Martin <eperezma@redhat.com>
To: Jonah Palmer <jonah.palmer@oracle.com>
Cc: qemu-devel@nongnu.org, eduardo@habkost.net,
	marcel.apfelbaum@gmail.com,  philmd@linaro.org,
	wangyanan55@huawei.com, zhao1.liu@intel.com,  mst@redhat.com,
	sgarzare@redhat.com, jasowang@redhat.com, leiyang@redhat.com,
	 si-wei.liu@oracle.com, boris.ostrovsky@oracle.com,
	armbru@redhat.com,  Juraj Marcin <jmarcin@redhat.com>
Subject: Re: [RFC v2 04/14] virtio-net: detect VirtIODevice status mid-migration change
Date: Thu, 26 Mar 2026 11:08:34 +0100	[thread overview]
Message-ID: <CAJaqyWdN7AYQnugLjwRr4sWDj_dGNg8JpmgBXprgLej_UD8ZUg@mail.gmail.com> (raw)
In-Reply-To: <654f2356-9c78-45df-95ff-de103557948b@oracle.com>

On Tue, Mar 24, 2026 at 4:02 PM Jonah Palmer <jonah.palmer@oracle.com> wrote:
>
>
>
> On 3/24/26 6:45 AM, Eugenio Perez Martin wrote:
> > On Fri, Mar 20, 2026 at 3:20 PM Jonah Palmer <jonah.palmer@oracle.com> wrote:
> >>
> >> This patch introduces the mechanism in which this series will use to
> >> detect VirtIODevice & VirtIONet state deltas, starting with the
> >> VirtIODevice's 'status' member of a virtio-net device.
> >>
> >> Before we send the device's state early, we save each piece of its state
> >> in a temporary structure via virtio_net_early_pre_save. Later, once the
> >> source VM has been paused,
> >
> > While I ack this approach should cover 99% of cases—as I think it is
> > unlikely the guest changes device properties during a live migration—I
> > still believe these changes should be sent when the guest modifies the
> > property, before it is paused. That way we shrink the downtime even
> > more. This comparison fits naturally: Instead of sending one state and
> > then the deltas at the switchover, we send the state and then the
> > delta for every change.
> >
> > However, I'm happy enough with this approach because it is more
> > self-contained within the migration code. It also reduces the state
> > sent over the migration channel if the guest changes its device status
> > many times.
> >
> > CCing Juraj as we discussed this at the virtio-net upstream meeting.
> >
>
> Right. I agree it would be optimal that, for every change made during
> live migration, the destination is updated with this change and it's not
> left to be handled once the source has been paused, which would impact
> guest-visible downtime (especially if it's an expensive change).
>
> However, the only way to handle mid-migration changes like this is via
> the SaveVMHandlers framework. I did give a stab at this approach in my
> v1 RFC series:
> https://lore.kernel.org/qemu-devel/20250722124127.2497406-1-jonah.palmer@oracle.com/
>
> However, Peter believed that this early-migration work would be better
> suited using the VMStateDescription framework instead. And the VMSD
> framework does not support handling these mid-migration changes before
> the stop-and-copy phase.
>

Right. But we can extend the VMStateDescription framework to support
asynchronous state sending as well. At first glance, it should just
add a new VMStateDescription to the struct SaveStateEntry, let's call
it live_vmsd, and call it at the same function that calls
SaveVMHandlers->save_live_iterate, which is
migration/savevm.c:qemu_savevm_state_iterate. The load version also
needs to be called when .load_state is called.

While this extends the series, I think little code is needed and I
believe it's the right long-term decision to avoid adding multiple
ways to solve the same problem. Again, is this ".early" version is the
best we can do, I'm pretty sure it solves most of the cases so, sure,
I'm all in :).



  reply	other threads:[~2026-03-26 10:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-20 14:20 [RFC v2 00/14] virtio-net: early VMStateDescription live migration support Jonah Palmer
2026-03-20 14:20 ` [RFC v2 01/14] machine,virtio-net: add early-mig property Jonah Palmer
2026-03-23 10:25   ` Eugenio Perez Martin
2026-03-24 14:07     ` Jonah Palmer
2026-03-26  8:02       ` Eugenio Perez Martin
2026-03-20 14:20 ` [RFC v2 02/14] virtio, virtio-net: add initial early VMSD for setup-phase migration Jonah Palmer via qemu development
2026-03-24  9:27   ` [RFC v2 02/14] virtio,virtio-net: " Eugenio Perez Martin
2026-03-24 14:28     ` Jonah Palmer
2026-03-24 14:38       ` Eugenio Perez Martin
2026-03-24 17:16         ` Jonah Palmer
2026-03-20 14:20 ` [RFC v2 03/14] virtio,virtio-net: virtio-delta VMSD - VQ state Jonah Palmer
2026-03-20 14:20 ` [RFC v2 04/14] virtio-net: detect VirtIODevice status mid-migration change Jonah Palmer
2026-03-24 10:45   ` Eugenio Perez Martin
2026-03-24 15:01     ` Jonah Palmer
2026-03-26 10:08       ` Eugenio Perez Martin [this message]
2026-03-20 14:20 ` [RFC v2 05/14] virtio-net: detect VirtIODevice config buffer " Jonah Palmer
2026-03-24 10:48   ` Eugenio Perez Martin
2026-03-24 15:25     ` Jonah Palmer
2026-03-20 14:20 ` [RFC v2 06/14] virtio-net: detect VirtIONet MAC addr " Jonah Palmer
2026-03-20 14:20 ` [RFC v2 07/14] virtio-net: detect VirtIONet MAC table mid-migration changes Jonah Palmer
2026-03-20 14:20 ` [RFC v2 08/14] virtio-net: detect VirtIONet status mid-migration change Jonah Palmer
2026-03-24 11:26   ` Eugenio Perez Martin
2026-03-24 16:23     ` Jonah Palmer
2026-03-26 10:20       ` Eugenio Perez Martin
2026-03-20 14:20 ` [RFC v2 09/14] virtio-net: detect VirtIONet Rx filter mid-migration changes Jonah Palmer
2026-03-20 14:20 ` [RFC v2 10/14] virtio-net: detect VirtIONet VLAN filter table changes Jonah Palmer
2026-03-20 14:20 ` [RFC v2 11/14] virtio-net: detect VirtIONet guest offload & MQ mid-migration changes Jonah Palmer
2026-03-20 14:20 ` [RFC v2 12/14] virtio-net: detect RSS state " Jonah Palmer
2026-03-20 14:20 ` [RFC v2 13/14] virtio-net: detect pending Tx work for VQs " Jonah Palmer
2026-03-24 11:35   ` Eugenio Perez Martin
2026-03-24 16:47     ` Jonah Palmer
2026-03-26 10:30       ` Eugenio Perez Martin
2026-03-20 14:20 ` [RFC v2 14/14] virtio-net, vhost-net: early migration support for vhost-net Jonah Palmer via qemu development

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=CAJaqyWdN7AYQnugLjwRr4sWDj_dGNg8JpmgBXprgLej_UD8ZUg@mail.gmail.com \
    --to=eperezma@redhat.com \
    --cc=armbru@redhat.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eduardo@habkost.net \
    --cc=jasowang@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=jonah.palmer@oracle.com \
    --cc=leiyang@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=si-wei.liu@oracle.com \
    --cc=wangyanan55@huawei.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox