From: Fabiano Rosas Date: Wed, 16 Jul 2025 18:26:47 +0000 (-0300) Subject: migration: HMP: Fix postcopy latency distribution label X-Git-Tag: v10.1.0-rc1~12^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd1514cbd97bcad5b3dc5d002cab6fee4d7cd45e;p=thirdparty%2Fqemu.git migration: HMP: Fix postcopy latency distribution label Fix the loop condition to avoid having a label with "1000 us" instead of "1 ms". Reported-by: Prasad Pandit Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/20250716182648.30202-3-farosas@suse.de Signed-off-by: Fabiano Rosas --- diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c index bb954881d7..a8b879c9d6 100644 --- a/migration/migration-hmp-cmds.c +++ b/migration/migration-hmp-cmds.c @@ -57,7 +57,7 @@ static const gchar *format_time_str(uint64_t us) const char *units[] = {"us", "ms", "sec"}; int index = 0; - while (us > 1000 && index + 1 < ARRAY_SIZE(units)) { + while (us >= 1000 && index + 1 < ARRAY_SIZE(units)) { us /= 1000; index++; }