mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
migration: Add save_postcopy_prepare() savevm handler
Add a savevm handler for a module to opt-in sending extra sections right before postcopy starts, and before VM is stopped. RAM will start to use this new savevm handler in the next patch to do flush and sync for multifd pages. Note that we choose to do it before VM stopped because the current only potential user is not sensitive to VM status, so doing it before VM is stopped is preferred to enlarge any postcopy downtime. It is still a bit unfortunate that we need to introduce such a new savevm handler just for the only use case, however it's so far the cleanest. Signed-off-by: Peter Xu <peterx@redhat.com> Signed-off-by: Prasad Pandit <pjp@fedoraproject.org> Reviewed-by: Fabiano Rosas <farosas@suse.de> Message-ID: <20250411114534.3370816-4-ppandit@redhat.com> Signed-off-by: Fabiano Rosas <farosas@suse.de>
This commit is contained in:
parent
00f3fcef19
commit
1d48111601
4 changed files with 53 additions and 0 deletions
|
@ -189,6 +189,21 @@ typedef struct SaveVMHandlers {
|
|||
|
||||
/* This runs outside the BQL! */
|
||||
|
||||
/**
|
||||
* @save_postcopy_prepare
|
||||
*
|
||||
* This hook will be invoked on the source side right before switching
|
||||
* to postcopy (before VM stopped).
|
||||
*
|
||||
* @f: QEMUFile where to send the data
|
||||
* @opaque: Data pointer passed to register_savevm_live()
|
||||
* @errp: Error** used to report error message
|
||||
*
|
||||
* Returns: true if succeeded, false if error occured. When false is
|
||||
* returned, @errp must be set.
|
||||
*/
|
||||
bool (*save_postcopy_prepare)(QEMUFile *f, void *opaque, Error **errp);
|
||||
|
||||
/**
|
||||
* @state_pending_estimate
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue