mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
migration: Split save_live_pending() into state_pending_*
We split the function into to: - state_pending_estimate: We estimate the remaining state size without stopping the machine. - state pending_exact: We calculate the exact amount of remaining state. The only "device" that implements different functions for _estimate() and _exact() is ram. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
parent
255dc7af7e
commit
c8df4a7aef
13 changed files with 143 additions and 76 deletions
|
@ -863,10 +863,10 @@ static int block_save_complete(QEMUFile *f, void *opaque)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void block_save_pending(void *opaque, uint64_t max_size,
|
||||
uint64_t *res_precopy_only,
|
||||
uint64_t *res_compatible,
|
||||
uint64_t *res_postcopy_only)
|
||||
static void block_state_pending(void *opaque, uint64_t max_size,
|
||||
uint64_t *res_precopy_only,
|
||||
uint64_t *res_compatible,
|
||||
uint64_t *res_postcopy_only)
|
||||
{
|
||||
/* Estimate pending number of bytes to send */
|
||||
uint64_t pending;
|
||||
|
@ -885,7 +885,7 @@ static void block_save_pending(void *opaque, uint64_t max_size,
|
|||
pending = BLK_MIG_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
trace_migration_block_save_pending(pending);
|
||||
trace_migration_block_state_pending(pending);
|
||||
/* We don't do postcopy */
|
||||
*res_precopy_only += pending;
|
||||
}
|
||||
|
@ -1020,7 +1020,8 @@ static SaveVMHandlers savevm_block_handlers = {
|
|||
.save_setup = block_save_setup,
|
||||
.save_live_iterate = block_save_iterate,
|
||||
.save_live_complete_precopy = block_save_complete,
|
||||
.save_live_pending = block_save_pending,
|
||||
.state_pending_exact = block_state_pending,
|
||||
.state_pending_estimate = block_state_pending,
|
||||
.load_state = block_load,
|
||||
.save_cleanup = block_migration_cleanup,
|
||||
.is_active = block_is_active,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue