qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] qemu: make version available in coredump
@ 2022-06-07 20:32 Vladimir Sementsov-Ogievskiy
  2023-02-15 21:19 ` Vladimir Sementsov-Ogievskiy
  2023-02-15 22:05 ` Stefan Hajnoczi
  0 siblings, 2 replies; 8+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2022-06-07 20:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, vsementsov

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



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-02-20  8:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-07 20:32 [PATCH] qemu: make version available in coredump Vladimir Sementsov-Ogievskiy
2023-02-15 21:19 ` Vladimir Sementsov-Ogievskiy
2023-02-15 22:05 ` Stefan Hajnoczi
2023-02-16  9:44   ` Daniel P. Berrangé
2023-02-16 11:30     ` Vladimir Sementsov-Ogievskiy
2023-02-16 12:03       ` Daniel P. Berrangé
2023-02-16 17:02         ` Vladimir Sementsov-Ogievskiy
2023-02-20  8:29   ` Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).