From: Bin Guo <guobin@linux.alibaba.com>
To: qemu-devel@nongnu.org
Cc: peterx@redhat.com, farosas@suse.de
Subject: [PATCH 2/3] migration: fix const mismatch in format_time_str()
Date: Thu, 16 Jul 2026 18:19:51 +0800 [thread overview]
Message-ID: <20260716101952.65329-3-guobin@linux.alibaba.com> (raw)
In-Reply-To: <20260716101952.65329-1-guobin@linux.alibaba.com>
format_time_str() returns a newly allocated string from
g_strdup_printf(), so the caller owns it. Return gchar * rather
than const gchar * to match the g_autofree callers.
Signed-off-by: Bin Guo <guobin@linux.alibaba.com>
---
migration/migration-hmp-cmds.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index 502ca704da..6bedf786df 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -54,7 +54,7 @@ static void migration_global_dump(Monitor *mon)
ms->clear_bitmap_shift);
}
-static const gchar *format_time_str(uint64_t us)
+static gchar *format_time_str(uint64_t us)
{
const char *units[] = {"us", "ms", "sec"};
int index = 0;
@@ -123,8 +123,8 @@ static void migration_dump_blocktime(Monitor *mon, MigrationInfo *info)
monitor_printf(mon, "Postcopy Latency Distribution:\n");
while (item) {
- g_autofree const gchar *from = format_time_str(1UL << count);
- g_autofree const gchar *to = format_time_str(1UL << (count + 1));
+ g_autofree gchar *from = format_time_str(1UL << count);
+ g_autofree gchar *to = format_time_str(1UL << (count + 1));
monitor_printf(mon, " [ %8s - %8s ]: %10"PRIu64"\n",
from, to, item->value);
--
2.50.1 (Apple Git-155)
next prev parent reply other threads:[~2026-07-16 10:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 10:19 [PATCH 0/3] migration: postcopy blocktime cleanups and assert fix Bin Guo
2026-07-16 10:19 ` [PATCH 1/3] migration: fix ineffective overflow assert in postcopy blocktime Bin Guo
2026-07-16 10:19 ` Bin Guo [this message]
2026-07-16 10:19 ` [PATCH 3/3] migration: clean up postcopy blocktime presentation Bin Guo
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=20260716101952.65329-3-guobin@linux.alibaba.com \
--to=guobin@linux.alibaba.com \
--cc=farosas@suse.de \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.