[PATCH] dump: fix misleading VMCOREINFO phys_base parse error

yujun posted 1 patch 3 weeks, 5 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260629114646.288664-1-yujun@kylinos.cn
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Ani Sinha <anisinha@redhat.com>
dump/dump.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH] dump: fix misleading VMCOREINFO phys_base parse error
Posted by yujun 3 weeks, 5 days ago
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")
Signed-off-by: yujun <yujun@kylinos.cn>
---
 dump/dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dump/dump.c b/dump/dump.c
index eb2ee1c10d..f69bc2d138 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -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
Re: [PATCH] dump: fix misleading VMCOREINFO phys_base parse error
Posted by Marc-André Lureau 3 weeks, 5 days ago
On Mon, Jun 29, 2026 at 3:52 PM yujun <yujun@kylinos.cn> wrote:
>
> 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")
> Signed-off-by: yujun <yujun@kylinos.cn>

Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  dump/dump.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/dump/dump.c b/dump/dump.c
> index eb2ee1c10d..f69bc2d138 100644
> --- a/dump/dump.c
> +++ b/dump/dump.c
> @@ -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
>