Skip to content

migration failure from qemu 7.1.0 to qemu 9.2.0+ with multifd capability enabled

Host environment

  • Operating system: CentOS Stream release 9
  • OS/kernel version: 6.4.3
  • Architecture: x86_64
  • QEMU flavor: qemu-system-x86_64
  • QEMU version: 7.1.0 / 9.2.0 / 9.2.50
  • QEMU command line:
    • migration source: qemu 7.1.0
    qemu-system-x86_64 -M pc-q35-7.1 -m 16G -nographic -net none -trace 'migration*'
    • migration destination: qemu 9.2.0+
    qemu-system-x86_64 -M pc-q35-7.1 -m 16G -nographic -incoming defer -net none -trace 'migration*'

Emulated/Virtualized environment

  • Operating system: n/a
  • OS/kernel version: n/a
  • Architecture: x86_64

Description of problem

Enabling multifd when doing migration from qemu 7.1.0 to 9.2.0+ causes the migration to fail. The migration status reported is:

Migration status: failed (Unable to write to socket: Broken pipe)

I could reproduce on qemu 9.2.0 and from a build from master. The migration is successful if I don't enable multifd.

I could not reproduce this issue migrating from 7.1.0 to 9.1.2.

Steps to reproduce

Minimal setup to reproduce below, running both qemu instances on the same host.

  1. Start qemu instance receiving the migration:
$ qemu-system-x86_64 -version
QEMU emulator version 9.2.50 (v9.2.0-28-ga5ba0a7e4e)

$ qemu-system-x86_64 -M pc-q35-7.1 -m 16G -nographic -incoming defer -net none -trace 'migration*'
[...]
(qemu) migrate_set_capability multifd on
(qemu) migrate_set_parameter multifd-channels 4
(qemu) migrate_incoming tcp:0:12345
[...]
(qemu) migration_socket_incoming_accepted
migration_set_incoming_channel ioc=0x5619735b1800 ioctype=qio-channel-socket
migration_socket_incoming_accepted
migration_set_incoming_channel ioc=0x561972dff670 ioctype=qio-channel-socket
migration_socket_incoming_accepted
migration_set_incoming_channel ioc=0x561972dad800 ioctype=qio-channel-socket
migration_socket_incoming_accepted
migration_set_incoming_channel ioc=0x561972c9d670 ioctype=qio-channel-socket
migration_socket_incoming_accepted
migration_set_incoming_channel ioc=0x561972c7b270 ioctype=qio-channel-socket
  1. Start the qemu instance that will be used to initiate the migration with multifd enabled, and initiate the migration
$ qemu-system-x86_64 -version
QEMU emulator version 7.1.0 (v7.1.0)

$ qemu-system-x86_64 -M pc-q35-7.1 -m 16G -nographic -net none -trace 'migration*'
[...]
(qemu) migrate_set_capability multifd on
(qemu) migrate_set_parameter multifd-channels 4
(qemu) migrate -d tcp:0:12345
(qemu) migration_socket_outgoing_connected hostname=0
migration_set_outgoing_channel ioc=0x558ea2051400 ioctype=qio-channel-socket hostname=0 err=(nil)
migration_bitmap_sync_start
migration_bitmap_sync_end dirty_pages 0
migration_thread_setup_complete
migration_bitmap_clear_dirty rb pc.ram start 0x0 size 0x40000000 page 0x0
migration_thread_after_loop
qemu-system-x86_64: Unable to write to socket: Broken pipe
(qemu) info migrate
globals:
store-global-state: on
only-migratable: off
send-configuration: on
send-section-footer: on
decompress-error-check: on
clear-bitmap-shift: 18
Migration status: failed (Unable to write to socket: Broken pipe)
total time: 0 ms
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information