qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] dump: use 10 base for phys_base


From: Zhibin Li
Subject: [PATCH] dump: use 10 base for phys_base
Date: Thu, 23 May 2024 16:32:05 +0800

>From vmcoreinfo 'phys_base' is a decimal instead a hexadecimal so use base of
10 instead of 16 when converting this string.

Signed-off-by: Zhibin Li <zhibin.li@intel.com>
---
Hi everyone. I'm trying to use 'dump-guest-memory' QMP command to generate a 
kdump-compressed vmcore file which can be consumed by makedumpfile tool (the 
command I used is: `dump-guest-memory -l -R test.bin`).

I found that the generated vmcore cannot be parsed correctly by 'makedumpfile' 
and I noticed that the 'phys_base' is incorrect with KASLR enabled. This is 
just a quick fix and please let me know if you have any comments.

By the way, with this fix 'makedumpfile' can proceed to handle the generated 
vmcore but later on some other issues were found. I'm still trying to debug 
this. If you have any BKMs about using 'makedumpfile' with QEMU please let me 
know. Thanks!

 dump/dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dump/dump.c b/dump/dump.c
index 84064d890d..e42ab3ccac 100644
--- a/dump/dump.c
+++ b/dump/dump.c
@@ -1760,7 +1760,7 @@ 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,
+            if (qemu_strtou64(lines[i] + strlen(prefix), NULL, 10,
                               &phys_base) < 0) {
                 warn_report("Failed to read %s", prefix);
             } else {
-- 
2.43.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]