Blame SOURCES/kvm-dump-guest-memory.py-fix-No-symbol-vmcoreinfo_find.patch

5d360b
From 6d5a6268d535d641147f16a5d0343beadaaab3d9 Mon Sep 17 00:00:00 2001
5d360b
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
5d360b
Date: Wed, 13 Dec 2017 13:39:11 +0100
5d360b
Subject: [PATCH 40/41] dump-guest-memory.py: fix No symbol "vmcoreinfo_find"
5d360b
MIME-Version: 1.0
5d360b
Content-Type: text/plain; charset=UTF-8
5d360b
Content-Transfer-Encoding: 8bit
5d360b
5d360b
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
5d360b
Message-id: <20171213133912.26176-41-marcandre.lureau@redhat.com>
5d360b
Patchwork-id: 78390
5d360b
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 40/41] dump-guest-memory.py: fix No symbol "vmcoreinfo_find"
5d360b
Bugzilla: 1411490
5d360b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
5d360b
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
5d360b
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
5d360b
When qemu is compiled without debug, the dump gdb python script can fail with:
5d360b
5d360b
Error occurred in Python command: No symbol "vmcoreinfo_find" in current context.
5d360b
5d360b
Because vmcoreinfo_find() is inlined and not exported.
5d360b
5d360b
Use the underlying object_resolve_path_type() to get the instance instead.
5d360b
5d360b
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5d360b
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
5d360b
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
5d360b
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
5d360b
5d360b
(cherry picked from commit d36d0a9d152316a41e02c2613a71f5859f407da1)
5d360b
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
5d360b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
5d360b
---
5d360b
 scripts/dump-guest-memory.py | 12 +++++++-----
5d360b
 1 file changed, 7 insertions(+), 5 deletions(-)
5d360b
5d360b
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
5d360b
index 471aa73..12b9b7d 100644
5d360b
--- a/scripts/dump-guest-memory.py
5d360b
+++ b/scripts/dump-guest-memory.py
5d360b
@@ -546,13 +546,15 @@ shape and this command should mostly work."""
5d360b
         return None
5d360b
 
5d360b
     def add_vmcoreinfo(self):
5d360b
-        if not gdb.parse_and_eval("vmcoreinfo_find()") \
5d360b
-           or not gdb.parse_and_eval("vmcoreinfo_find()->has_vmcoreinfo"):
5d360b
+        vmci = '(VMCoreInfoState *)' + \
5d360b
+               'object_resolve_path_type("", "vmcoreinfo", 0)'
5d360b
+        if not gdb.parse_and_eval("%s" % vmci) \
5d360b
+           or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci):
5d360b
             return
5d360b
 
5d360b
-        fmt = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.guest_format")
5d360b
-        addr = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.paddr")
5d360b
-        size = gdb.parse_and_eval("vmcoreinfo_find()->vmcoreinfo.size")
5d360b
+        fmt = gdb.parse_and_eval("(%s)->vmcoreinfo.guest_format" % vmci)
5d360b
+        addr = gdb.parse_and_eval("(%s)->vmcoreinfo.paddr" % vmci)
5d360b
+        size = gdb.parse_and_eval("(%s)->vmcoreinfo.size" % vmci)
5d360b
 
5d360b
         fmt = le16_to_cpu(fmt)
5d360b
         addr = le64_to_cpu(addr)
5d360b
-- 
5d360b
1.8.3.1
5d360b