[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 15/40] migration: Set downtime_start even for postcopy
From: |
Juan Quintela |
Subject: |
[PULL 15/40] migration: Set downtime_start even for postcopy |
Date: |
Thu, 2 Nov 2023 12:40:29 +0100 |
From: Peter Xu <peterx@redhat.com>
Postcopy calculates its downtime separately. It always sets
MigrationState.downtime properly, but not MigrationState.downtime_start.
Make postcopy do the same as other modes on properly recording the
timestamp when the VM is going to be stopped. Drop the temporary variable
in postcopy_start() along the way.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231030163346.765724-2-peterx@redhat.com>
---
migration/migration.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 6abcbefd9c..6dcdc5be2b 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2126,7 +2126,6 @@ static int postcopy_start(MigrationState *ms, Error
**errp)
int ret;
QIOChannelBuffer *bioc;
QEMUFile *fb;
- int64_t time_at_stop = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
uint64_t bandwidth = migrate_max_postcopy_bandwidth();
bool restart_block = false;
int cur_state = MIGRATION_STATUS_ACTIVE;
@@ -2148,6 +2147,8 @@ static int postcopy_start(MigrationState *ms, Error
**errp)
qemu_mutex_lock_iothread();
trace_postcopy_start_set_run();
+ ms->downtime_start = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+
qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL);
global_state_store();
ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
@@ -2250,7 +2251,7 @@ static int postcopy_start(MigrationState *ms, Error
**errp)
ms->postcopy_after_devices = true;
migration_call_notifiers(ms);
- ms->downtime = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - time_at_stop;
+ ms->downtime = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - ms->downtime_start;
qemu_mutex_unlock_iothread();
--
2.41.0
- [PULL 05/40] migration: Create vmstate_register_any(), (continued)
- [PULL 05/40] migration: Create vmstate_register_any(), Juan Quintela, 2023/11/02
- [PULL 06/40] migration: Use vmstate_register_any(), Juan Quintela, 2023/11/02
- [PULL 07/40] migration: Use vmstate_register_any() for isa-ide, Juan Quintela, 2023/11/02
- [PULL 08/40] migration: Use VMSTATE_INSTANCE_ID_ANY for slirp, Juan Quintela, 2023/11/02
- [PULL 09/40] migration: Hack to maintain backwards compatibility for ppc, Juan Quintela, 2023/11/02
- [PULL 11/40] migration: Improve example and documentation of vmstate_register(), Juan Quintela, 2023/11/02
- [PULL 10/40] migration: Check in savevm_state_handler_insert for dups, Juan Quintela, 2023/11/02
- [PULL 13/40] migration: Use vmstate_register_any() for eeprom93xx, Juan Quintela, 2023/11/02
- [PULL 12/40] migration: Use vmstate_register_any() for audio, Juan Quintela, 2023/11/02
- [PULL 14/40] migration: Use vmstate_register_any() for vmware_vga, Juan Quintela, 2023/11/02
- [PULL 15/40] migration: Set downtime_start even for postcopy,
Juan Quintela <=
- [PULL 16/40] migration: Add migration_downtime_start|end() helpers, Juan Quintela, 2023/11/02
- [PULL 19/40] migration: Add tracepoints for downtime checkpoints, Juan Quintela, 2023/11/02
- [PULL 17/40] migration: Add per vmstate downtime tracepoints, Juan Quintela, 2023/11/02
- [PULL 20/40] migration: mode parameter, Juan Quintela, 2023/11/02
- [PULL 21/40] migration: per-mode blockers, Juan Quintela, 2023/11/02
- [PULL 18/40] migration: migration_stop_vm() helper, Juan Quintela, 2023/11/02
- [PULL 22/40] cpr: relax blockdev migration blockers, Juan Quintela, 2023/11/02