]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
migration: HMP: Fix postcopy latency distribution label
authorFabiano Rosas <farosas@suse.de>
Wed, 16 Jul 2025 18:26:47 +0000 (15:26 -0300)
committerFabiano Rosas <farosas@suse.de>
Tue, 22 Jul 2025 22:39:29 +0000 (19:39 -0300)
Fix the loop condition to avoid having a label with "1000 us" instead
of "1 ms".

Reported-by: Prasad Pandit <ppandit@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Link: https://lore.kernel.org/qemu-devel/20250716182648.30202-3-farosas@suse.de
Signed-off-by: Fabiano Rosas <farosas@suse.de>
migration/migration-hmp-cmds.c

index bb954881d782b7781a43b0d6544ef793dc82bb7e..a8b879c9d60eae5120294f0992ce3f45dfd1a96f 100644 (file)
@@ -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++;
     }