Am 23.09.26 um 16:15 schrieb Konstantin Shkolnyy:
Up until now QEMU marked any zPCI device as "unmigratable."

This patch series adds support for migrating emulated devices, which are
simpler to migrate. It leaves VFIO devices still unmigratable.

To enable migration, the device state needs to be saved/restored to/from
the migration stream.

There are 2 kinds of emulated devices - those that use the zPCI IOMMU page
table emulation in QEMU (e.g., Intel IGB NIC), and those that don't (virtio).
This is important to note for testing purposes.

This change was tested on IGB, virtio-net and virtio-blk devices by running
I/O on them while performing "virsh managedsave, virsh start" and also live
migration to another host and back.



FWIW, I asked an AI to test this series and I can confirm it works:
Pre-series baseline: the same guest cannot be saved at all: "State blocked by
non-migratable device 'zpci'".

Managedsave and restore: completes, the guest resumes with identical PCI 
functions,
reads from both virtio-rng devices keep working, and the MSI counter keeps 
climbing.
The stream carries the enabled state, the IOAT registration, the MSI-X 
indicators and
ISC, and the FMB address for all three functions, and the FMB sample counter 
advanced
across the restore.

IOMMU replay confirmed: with translation tracing on the restored instance, the 
device
configured with iommu_platform=on produced 12,299 translations for a 256 KiB 
read and
the bypass device none, with six translations already during the load itself 
from virtio
reading its rings. That is the priority ordering and the replay doing their 
jobs.

After restore: hotplug of a new function and unplug of an existing one both 
work, a second
save/restore chain into a third process works, and savevm/loadvm on a running 
guest works
twice, including with a device that was hotplugged after the snapshot.

Reply via email to