qemu-devel
[Top][All Lists]
Advanced

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

[PATCH] qemu: make version available in coredump


From: Vladimir Sementsov-Ogievskiy
Subject: [PATCH] qemu: make version available in coredump
Date: Tue, 7 Jun 2022 23:32:21 +0300

Add a variable with QEMU_FULL_VERSION definition. Then the content of
the variable is easily searchable:

   strings /path/to/core | grep QEMU_FULL_VERSION

'volatile' keyword is used to avoid removing the variable by compiler as
unused.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---

Hi all!

Probably, I just don't know the correct way to get version from core
file. If so, please teach me :)

 softmmu/vl.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/softmmu/vl.c b/softmmu/vl.c
index 4c1e94b00e..1f51a713a0 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -164,6 +164,19 @@ typedef struct DeviceOption {
     QTAILQ_ENTRY(DeviceOption) next;
 } DeviceOption;
 
+/*
+ * qemu_full_version_decl is for debugging. Assume you have coredump file, but
+ * don't know the version neither have original qemu binary file. You need to
+ * download a package with corresponding binary (and debug package with
+ * symbols), but which one? You need the version.
+ *
+ * This variable makes it simple to get the version by command
+ *
+ *     strings path/to/core | grep QEMU_FULL_VERSION
+ */
+static volatile const char qemu_full_version_decl[] =
+    "QEMU_FULL_VERSION: " QEMU_FULL_VERSION;
+
 static const char *cpu_option;
 static const char *mem_path;
 static const char *incoming;
-- 
2.25.1




reply via email to

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