[PATCH 00/10] migration/colo: small cleanup series

Peter Xu posted 10 patches 2 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260121223336.3381912-1-peterx@redhat.com
Maintainers: Hailiang Zhang <zhanghailiang@xfusion.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Markus Armbruster <armbru@redhat.com>
migration/savevm.h    |  4 +-
migration/colo.c      |  9 ++---
migration/migration.c |  2 +-
migration/savevm.c    | 91 +++++++++++++++++++++----------------------
monitor/qmp-cmds.c    |  3 ++
5 files changed, 55 insertions(+), 54 deletions(-)
[PATCH 00/10] migration/colo: small cleanup series
Posted by Peter Xu 2 weeks, 2 days ago
CI: https://gitlab.com/peterx/qemu/-/pipelines/2277445319

While reading COLO in the past two days, I got a few small patches to clean
up here and there.  I also ran this with the COLO qtests [*] and it ran all fine.

Comments welcomed, thanks.

[*] https://lore.kernel.org/r/20260117-colo_unit_test_multifd-v2-0-ab521777fa51@web.de

Peter Xu (10):
  migration: Introduce qemu_savevm_send_* helpers
  migration: Use qemu_savevm_send_header() in qemu_save_device_state()
  migration: Remove one migration_in_colo_state() occurance
  migration/savevm: Remove SaveStateEntry.is_ram
  migration/colo: Unwrap qemu_savevm_live_state()
  migration/colo: Remove call to send switchover start event
  colo: Forbid VM resume during checkpointing
  migration/colo: Use the RAM iterable helper directly
  migration/colo: Move qemu_fflush() closer to its user for fb
  migration: Drop iterable_only in qemu_savevm_state_complete_precopy

 migration/savevm.h    |  4 +-
 migration/colo.c      |  9 ++---
 migration/migration.c |  2 +-
 migration/savevm.c    | 91 +++++++++++++++++++++----------------------
 monitor/qmp-cmds.c    |  3 ++
 5 files changed, 55 insertions(+), 54 deletions(-)

-- 
2.50.1
Re: [PATCH 00/10] migration/colo: small cleanup series
Posted by Lukas Straub 1 week, 5 days ago
On Wed, 21 Jan 2026 17:33:25 -0500
Peter Xu <peterx@redhat.com> wrote:

> CI: https://gitlab.com/peterx/qemu/-/pipelines/2277445319
> 
> While reading COLO in the past two days, I got a few small patches to clean
> up here and there.  I also ran this with the COLO qtests [*] and it ran all fine.
> 
> Comments welcomed, thanks.
> 
> [*] https://lore.kernel.org/r/20260117-colo_unit_test_multifd-v2-0-ab521777fa51@web.de

Hmm,
It fails for me on top of current master, but works fine wthout this patchset:
# Running /x86_64/migration/colo/plain/primary_failover
# Using machine type: pc-i440fx-11.0
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-3157.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-3157.qmp,id=char0 -mon chardev=char0,mode=control -display none -audio none -run-with exit-with-parent=on -accel kvm -accel tcg -machine pc-i440fx-11.0, -name source,debug-threads=on -machine memory-backend=mig.mem -object memory-backend-ram,id=mig.mem,size=150M,share=off -serial file:/tmp/migration-test-OZFSJ3/src_serial -drive if=none,id=d0,file=/tmp/migration-test-OZFSJ3/bootsect,format=raw -device ide-hd,drive=d0,secs=1,cyls=1,heads=1 -snapshot  -accel qtest
# starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-3157.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-3157.qmp,id=char0 -mon chardev=char0,mode=control -display none -audio none -run-with exit-with-parent=on -accel kvm -accel tcg -machine pc-i440fx-11.0, -name target,debug-threads=on -machine memory-backend=mig.mem -object memory-backend-ram,id=mig.mem,size=150M,share=off -serial file:/tmp/migration-test-OZFSJ3/dest_serial -incoming tcp:127.0.0.1:0  -drive if=none,id=d0,file=/tmp/migration-test-OZFSJ3/bootsect,format=raw -device ide-hd,drive=d0,secs=1,cyls=1,heads=1 -snapshot  -accel qtest
qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:03.0/e1000': Loading VM subsection 'e1000/full_mac_state' in 'e1000' failed: -5: Failed to load e1000/full_mac_state state: stream error: -5

> 
> Peter Xu (10):
>   migration: Introduce qemu_savevm_send_* helpers
>   migration: Use qemu_savevm_send_header() in qemu_save_device_state()
>   migration: Remove one migration_in_colo_state() occurance
>   migration/savevm: Remove SaveStateEntry.is_ram
>   migration/colo: Unwrap qemu_savevm_live_state()
>   migration/colo: Remove call to send switchover start event
>   colo: Forbid VM resume during checkpointing
>   migration/colo: Use the RAM iterable helper directly
>   migration/colo: Move qemu_fflush() closer to its user for fb
>   migration: Drop iterable_only in qemu_savevm_state_complete_precopy
> 
>  migration/savevm.h    |  4 +-
>  migration/colo.c      |  9 ++---
>  migration/migration.c |  2 +-
>  migration/savevm.c    | 91 +++++++++++++++++++++----------------------
>  monitor/qmp-cmds.c    |  3 ++
>  5 files changed, 55 insertions(+), 54 deletions(-)
> 

Re: [PATCH 00/10] migration/colo: small cleanup series
Posted by Peter Xu 1 week, 4 days ago
On Sun, Jan 25, 2026 at 08:29:15PM +0100, Lukas Straub wrote:
> On Wed, 21 Jan 2026 17:33:25 -0500
> Peter Xu <peterx@redhat.com> wrote:
> 
> > CI: https://gitlab.com/peterx/qemu/-/pipelines/2277445319
> > 
> > While reading COLO in the past two days, I got a few small patches to clean
> > up here and there.  I also ran this with the COLO qtests [*] and it ran all fine.
> > 
> > Comments welcomed, thanks.
> > 
> > [*] https://lore.kernel.org/r/20260117-colo_unit_test_multifd-v2-0-ab521777fa51@web.de
> 
> Hmm,
> It fails for me on top of current master, but works fine wthout this patchset:
> # Running /x86_64/migration/colo/plain/primary_failover
> # Using machine type: pc-i440fx-11.0
> # starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-3157.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-3157.qmp,id=char0 -mon chardev=char0,mode=control -display none -audio none -run-with exit-with-parent=on -accel kvm -accel tcg -machine pc-i440fx-11.0, -name source,debug-threads=on -machine memory-backend=mig.mem -object memory-backend-ram,id=mig.mem,size=150M,share=off -serial file:/tmp/migration-test-OZFSJ3/src_serial -drive if=none,id=d0,file=/tmp/migration-test-OZFSJ3/bootsect,format=raw -device ide-hd,drive=d0,secs=1,cyls=1,heads=1 -snapshot  -accel qtest
> # starting QEMU: exec ./qemu-system-x86_64 -qtest unix:/tmp/qtest-3157.sock -qtest-log /dev/null -chardev socket,path=/tmp/qtest-3157.qmp,id=char0 -mon chardev=char0,mode=control -display none -audio none -run-with exit-with-parent=on -accel kvm -accel tcg -machine pc-i440fx-11.0, -name target,debug-threads=on -machine memory-backend=mig.mem -object memory-backend-ram,id=mig.mem,size=150M,share=off -serial file:/tmp/migration-test-OZFSJ3/dest_serial -incoming tcp:127.0.0.1:0  -drive if=none,id=d0,file=/tmp/migration-test-OZFSJ3/bootsect,format=raw -device ide-hd,drive=d0,secs=1,cyls=1,heads=1 -snapshot  -accel qtest
> qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:03.0/e1000': Loading VM subsection 'e1000/full_mac_state' in 'e1000' failed: -5: Failed to load e1000/full_mac_state state: stream error: -5

Somehow I didn't hit it previously, but at least when using your latest
patches it hangs for me (rather than failing..).

Patch 9 is broken, because I overlooked COLO_MESSAGE_VMSTATE_SIZE also
needs to reference bioc->usage.

I'll fix patch 9 when repost.  Thanks for the report.

--
Peter Xu