diff options
author | Juan Quintela <quintela@redhat.com> | 2022-10-03 02:00:03 +0200 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2023-02-06 19:22:56 +0100 |
commit | c8df4a7aeffcb46020f610526eea621fa5b0cd47 (patch) | |
tree | ac98cf649da17c85020015bfe7632c8c9b153685 /migration/block.c | |
parent | 255dc7af7e65588d36319129718ddfdfeabac898 (diff) | |
download | qemu-c8df4a7aeffcb46020f610526eea621fa5b0cd47.zip qemu-c8df4a7aeffcb46020f610526eea621fa5b0cd47.tar.gz qemu-c8df4a7aeffcb46020f610526eea621fa5b0cd47.tar.bz2 |
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>
Diffstat (limited to 'migration/block.c')
-rw-r--r-- | migration/block.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/migration/block.c b/migration/block.c index 47852b8..544e74e 100644 --- a/migration/block.c +++ b/migration/block.c @@ -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, |