[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 20/30] migration: Show downtime during postcopy phase
From: |
Juan Quintela |
Subject: |
[PULL 20/30] migration: Show downtime during postcopy phase |
Date: |
Tue, 7 Feb 2023 01:56:40 +0100 |
From: Peter Xu <peterx@redhat.com>
The downtime should be displayed during postcopy phase because the
switchover phase is done. OTOH it's weird to show "expected downtime"
which can confuse what does that mean if the switchover has already
happened anyway.
This is a slight ABI change on QMP, but I assume it shouldn't affect
anyone.
Reviewed-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
migration/migration.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index f321e419c7..4f4d798d3e 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1051,20 +1051,30 @@ bool migration_is_running(int state)
}
}
+static bool migrate_show_downtime(MigrationState *s)
+{
+ return (s->state == MIGRATION_STATUS_COMPLETED) || migration_in_postcopy();
+}
+
static void populate_time_info(MigrationInfo *info, MigrationState *s)
{
info->has_status = true;
info->has_setup_time = true;
info->setup_time = s->setup_time;
+
if (s->state == MIGRATION_STATUS_COMPLETED) {
info->has_total_time = true;
info->total_time = s->total_time;
- info->has_downtime = true;
- info->downtime = s->downtime;
} else {
info->has_total_time = true;
info->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) -
s->start_time;
+ }
+
+ if (migrate_show_downtime(s)) {
+ info->has_downtime = true;
+ info->downtime = s->downtime;
+ } else {
info->has_expected_downtime = true;
info->expected_downtime = s->expected_downtime;
}
--
2.39.1
- [PULL 10/30] migration/ram: Rely on used_length for uffd_change_protection(), (continued)
- [PULL 10/30] migration/ram: Rely on used_length for uffd_change_protection(), Juan Quintela, 2023/02/06
- [PULL 11/30] migration/ram: Optimize ram_write_tracking_start() for RamDiscardManager, Juan Quintela, 2023/02/06
- [PULL 12/30] migration/savevm: Move more savevm handling into vmstate_save(), Juan Quintela, 2023/02/06
- [PULL 13/30] migration/savevm: Prepare vmdesc json writer in qemu_savevm_state_setup(), Juan Quintela, 2023/02/06
- [PULL 14/30] migration/savevm: Allow immutable device state to be migrated early (i.e., before RAM), Juan Quintela, 2023/02/06
- [PULL 15/30] migration/vmstate: Introduce VMSTATE_WITH_TMP_TEST() and VMSTATE_BITMAP_TEST(), Juan Quintela, 2023/02/06
- [PULL 16/30] migration/ram: Factor out check for advised postcopy, Juan Quintela, 2023/02/06
- [PULL 18/30] virtio-mem: Migrate immutable properties early, Juan Quintela, 2023/02/06
- [PULL 17/30] virtio-mem: Fail if a memory backend with "prealloc=on" is specified, Juan Quintela, 2023/02/06
- [PULL 19/30] virtio-mem: Proper support for preallocation with migration, Juan Quintela, 2023/02/06
- [PULL 20/30] migration: Show downtime during postcopy phase,
Juan Quintela <=
- [PULL 21/30] migration/rdma: fix return value for qio_channel_rdma_{readv, writev}, Juan Quintela, 2023/02/06
- [PULL 22/30] migration: Add canary to VMSTATE_END_OF_LIST, Juan Quintela, 2023/02/06
- [PULL 23/30] migration: Perform vmsd structure check during tests, Juan Quintela, 2023/02/06
- [PULL 24/30] migration/dirtyrate: Show sample pages only in page-sampling mode, Juan Quintela, 2023/02/06
- [PULL 25/30] io: Add support for MSG_PEEK for socket channel, Juan Quintela, 2023/02/06
- [PULL 26/30] migration: check magic value for deciding the mapping of channels, Juan Quintela, 2023/02/06
- [PULL 27/30] multifd: Fix a race on reading MultiFDPages_t.block, Juan Quintela, 2023/02/06
- [PULL 28/30] multifd: Fix flush of zero copy page send request, Juan Quintela, 2023/02/06