diff options
author | Maciej S. Szmigiero <maciej.szmigiero@oracle.com> | 2025-03-04 23:03:54 +0100 |
---|---|---|
committer | Cédric Le Goater <clg@redhat.com> | 2025-03-06 06:47:34 +0100 |
commit | c59748c1ff924963a67af9efd7e1a1ee6f82d6d6 (patch) | |
tree | d9d9644e1aa18d3760232159df14bed797b85042 /docs/devel/migration | |
parent | 3228d311ab1882f75b04d080d33a71fc7a0bcac5 (diff) | |
download | qemu-c59748c1ff924963a67af9efd7e1a1ee6f82d6d6.zip qemu-c59748c1ff924963a67af9efd7e1a1ee6f82d6d6.tar.gz qemu-c59748c1ff924963a67af9efd7e1a1ee6f82d6d6.tar.bz2 |
vfio/migration: Multifd device state transfer support - load thread
Add a thread which loads the VFIO device state buffers that were received
via multifd.
Each VFIO device that has multifd device state transfer enabled has one
such thread, which is created using migration core API
qemu_loadvm_start_load_thread().
Since it's important to finish loading device state transferred via the
main migration channel (via save_live_iterate SaveVMHandler) before
starting loading the data asynchronously transferred via multifd the thread
doing the actual loading of the multifd transferred data is only started
from switchover_start SaveVMHandler.
switchover_start handler is called when MIG_CMD_SWITCHOVER_START
sub-command of QEMU_VM_COMMAND is received via the main migration channel.
This sub-command is only sent after all save_live_iterate data have already
been posted so it is safe to commence loading of the multifd-transferred
device state upon receiving it - loading of save_live_iterate data happens
synchronously in the main migration thread (much like the processing of
MIG_CMD_SWITCHOVER_START) so by the time MIG_CMD_SWITCHOVER_START is
processed all the proceeding data must have already been loaded.
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/9abe612d775aaf42e31646796acd2363c723a57a.1741124640.git.maciej.szmigiero@oracle.com
[ clg: - Reordered savevm_vfio_handlers
- Added switchover_start documentation ]
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'docs/devel/migration')
-rw-r--r-- | docs/devel/migration/vfio.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/devel/migration/vfio.rst b/docs/devel/migration/vfio.rst index 8b1f288..d6cf608 100644 --- a/docs/devel/migration/vfio.rst +++ b/docs/devel/migration/vfio.rst @@ -67,6 +67,10 @@ VFIO implements the device hooks for the iterative approach as follows: * A ``switchover_ack_needed`` function that checks if the VFIO device uses "switchover-ack" migration capability when this capability is enabled. +* A ``switchover_start`` function that in the multifd mode starts a thread that + reassembles the multifd received data and loads it in-order into the device. + In the non-multifd mode this function is a NOP. + * A ``save_state`` function to save the device config space if it is present. * A ``save_live_complete_precopy`` function that sets the VFIO device in |