migration: Fix invalid %ud format and trace arg typo
Standard printf has no %ud conversion; glibc treats it as %u followed by a literal 'd', so postcopy userfaultfd error messages printed event values like "5d" instead of "5". The same typo existed in two postcopy discard trace format strings. Also rename the misspelled ram_save_iterate_big_wait() trace argument milliconds to milliseconds. Fixes: 00fa4fc85b ("postcopy: Allow registering of fd handler") Signed-off-by: yujun <yujun@kylinos.cn> Reviewed-by: Fabiano Rosas <farosas@suse.de> Link: https://lore.kernel.org/r/20260630031324.43453-1-yujun@kylinos.cn Signed-off-by: Peter Xu <peterx@redhat.com>
yujun committed
Jun 30, 2026 at 11:13 UTC
8ba384cc322a6a74112d80dc49c3cac40ee102e2
2 files changed
+5
-5
migration/postcopy-ram.c
+2
-2
@@ -1368,7 +1368,7 @@ static void *postcopy_ram_fault_thread(void *opaque)
1368
}
1369
}
1370
if (msg.event != UFFD_EVENT_PAGEFAULT) {
1371
- error_report("%s: Read unexpected event %ud from userfaultfd",
1371
+ error_report("%s: Read unexpected event %u from userfaultfd",
1372
__func__, msg.event);
1373
continue; /* It's not a page fault, shouldn't happen */
1374
}
@@ -1443,7 +1443,7 @@ retry:
1443
}
1444
}
1445
if (msg.event != UFFD_EVENT_PAGEFAULT) {
1446
- error_report("%s: Read unexpected event %ud "
1446
+ error_report("%s: Read unexpected event %u "
1447
"from userfaultfd (shared)",
1448
__func__, msg.event);
1449
continue; /* It's not a page fault, shouldn't happen */
migration/trace-events
+3
-3
@@ -21,14 +21,14 @@ loadvm_postcopy_handle_run(void) ""
21
loadvm_postcopy_handle_resume(void) ""
22
loadvm_postcopy_ram_handle_discard(void) ""
23
loadvm_postcopy_ram_handle_discard_end(void) ""
24
-loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len) "%s: %ud"
24
+loadvm_postcopy_ram_handle_discard_header(const char *ramid, uint16_t len) "%s: %u"
25
loadvm_process_command(const char *s, uint16_t len) "com=%s len=%d"
26
loadvm_process_command_ping(uint32_t val) "0x%x"
27
loadvm_approve_switchover(unsigned int switchover_ack_pending_num) "Switchover ack pending num=%u"
28
postcopy_ram_listen_thread_exit(void) ""
29
postcopy_ram_listen_thread_start(void) ""
30
qemu_savevm_send_postcopy_advise(void) ""
31
-qemu_savevm_send_postcopy_ram_discard(const char *id, uint16_t len) "%s: %ud"
31
+qemu_savevm_send_postcopy_ram_discard(const char *id, uint16_t len) "%s: %u"
32
savevm_command_send(uint16_t command, uint16_t len) "com=0x%x len=%d"
33
savevm_section_start(const char *id, unsigned int section_id) "%s, section_id %u"
34
savevm_section_end(const char *id, unsigned int section_id, int ret) "%s, section_id %u -> %d"
@@ -119,7 +119,7 @@ colo_flush_ram_cache_begin(uint64_t dirty_pages) "dirty_pages %" PRIu64
119
colo_flush_ram_cache_end(void) ""
120
save_xbzrle_page_skipping(void) ""
121
save_xbzrle_page_overflow(void) ""
122
-ram_save_iterate_big_wait(uint64_t milliconds, int iterations) "big wait: %" PRIu64 " milliseconds, %d iterations"
122
+ram_save_iterate_big_wait(uint64_t milliseconds, int iterations) "big wait: %" PRIu64 " milliseconds, %d iterations"
123
ram_load_start(void) ""
124
ram_load_complete(int ret, uint64_t seq_iter) "exit_code %d seq iteration %" PRIu64
125
ram_write_tracking_ramblock_start(const char *block_id, size_t page_size, void *addr, size_t length) "%s: page_size: %zu addr: %p length: %zu"