From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juan Quintela <quintela@redhat.com>,
Leonardo Bras Soares Passos <lsoaresp@redhat.com>,
"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
peterx@redhat.com
Subject: [PATCH] migration: Show downtime during postcopy phase
Date: Thu, 15 Dec 2022 17:24:48 -0500 [thread overview]
Message-ID: <20221215222448.1893656-1-peterx@redhat.com> (raw)
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.
Signed-off-by: Peter Xu <peterx@redhat.com>
---
migration/migration.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 64f74534e2..993782598f 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1077,20 +1077,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.37.3
next reply other threads:[~2022-12-15 22:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-15 22:24 Peter Xu [this message]
2022-12-20 16:42 ` [PATCH] migration: Show downtime during postcopy phase Leonardo Bras Soares Passos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221215222448.1893656-1-peterx@redhat.com \
--to=peterx@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lsoaresp@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).