mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
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>
This commit is contained in:
parent
3228d311ab
commit
c59748c1ff
5 changed files with 251 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue