Skip to contentSkip to conversation

dump: fix misleading VMCOREINFO phys_base parse error

PATCH In review yujun 2 participants 2 messages Jun 29

lore
Share & tools
lore

yujun

author
#0 lore raw

PATCH 1/1 dump: fix misleading VMCOREINFO phys_base parse error

When qemu_strtou64() fails on the value after NUMBER(phys_base)= or NUMBER(PHYS_OFFSET)=, report a parse failure and include the malformed value. The previous message suggested the field name itself could not be read.

Fixes d9feb51772 ("dump: update phys_base header field based on VMCOREINFO content")
---
 dump/dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
dump/dump.c +2 -1
index eb2ee1c10d..f69bc2d138 100644
@@ -1771,7 +1771,8 @@ static void vmcoreinfo_update_phys_base(DumpState *s)
         if (prefix && g_str_has_prefix(lines[i], prefix)) {
             if (qemu_strtou64(lines[i] + strlen(prefix), NULL, 16,
                               &phys_base) < 0) {
-                warn_report("Failed to read %s", prefix);
+                warn_report("failed to parse %s in VMCOREINFO: '%s'",
+                            prefix, lines[i] + strlen(prefix));
             } else {
                 s->dump_info.phys_base = phys_base;
             }
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · yujun

When qemu_strtou64() fails on the value after NUMBER(phys_base)= or NUMBER(PHYS_OFFSET)=, report a parse failure and include the malformed value. The previous message suggested the field name itself could not be read.

Fixes d9feb51772 ("dump: update phys_base header field based on VMCOREINFO content")
Quoted 21 lines
---
 dump/dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
dump/dump.c +2 -2
index eb2ee1c10d..f69bc2d138 100644
@@ -1771,7 +1771,8 @@ static void vmcoreinfo_update_phys_base(DumpState *s)
         if (prefix && g_str_has_prefix(lines[i], prefix)) {
             if (qemu_strtou64(lines[i] + strlen(prefix), NULL, 16,
                               &phys_base) < 0) {
-                warn_report("Failed to read %s", prefix);
+                warn_report("failed to parse %s in VMCOREINFO: '%s'",
+                            prefix, lines[i] + strlen(prefix));
             } else {
                 s->dump_info.phys_base = phys_base;
             }
--

2.25.1