Blame SOURCES/kvm-dump-guest-memory.py-skip-vmcoreinfo-section-if-not-.patch

4a2fec
From cfa9ef75d5a2e814368940c0b6e70981bd082169 Mon Sep 17 00:00:00 2001
4a2fec
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
4a2fec
Date: Mon, 5 Feb 2018 16:38:47 +0100
4a2fec
Subject: [PATCH 19/20] dump-guest-memory.py: skip vmcoreinfo section if not
4a2fec
 available
4a2fec
MIME-Version: 1.0
4a2fec
Content-Type: text/plain; charset=UTF-8
4a2fec
Content-Transfer-Encoding: 8bit
4a2fec
4a2fec
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
4a2fec
Message-id: <20180205163847.12004-1-marcandre.lureau@redhat.com>
4a2fec
Patchwork-id: 78897
4a2fec
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH] dump-guest-memory.py: skip vmcoreinfo section if not available
4a2fec
Bugzilla: 1398633
4a2fec
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
4a2fec
RH-Acked-by: Thomas Huth <thuth@redhat.com>
4a2fec
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
4a2fec
4a2fec
On some architectures, qemu doesn't support vmcoreinfo device,
4a2fec
and dump-guest-memory fails:
4a2fec
4a2fec
(gdb) dump-guest-memory /tmp/vmcore  ppc64-le
4a2fec
guest RAM blocks:
4a2fec
target_start     target_end       host_addr        message count
4a2fec
---------------- ---------------- ---------------- ------- -----
4a2fec
0000000000000000 0000000200000000 00003ffd86980000 added       1
4a2fec
0000200080000000 0000200080800000 00003ffd86170000 added       2
4a2fec
Python Exception <class 'gdb.error'> No symbol "vmcoreinfo_realize" in current context.:
4a2fec
Error occurred in Python command: No symbol "vmcoreinfo_realize" in current context.
4a2fec
4a2fec
Check that vmcoreinfo_realize symbol exists before evaluating an
4a2fec
expression with it.
4a2fec
4a2fec
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4a2fec
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
4a2fec
4a2fec
(cherry picked from commit ce6b9e421a9ab45d7e6c97af092a07c049954444)
4a2fec
4a2fec
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 scripts/dump-guest-memory.py | 2 ++
4a2fec
 1 file changed, 2 insertions(+)
4a2fec
4a2fec
diff --git a/scripts/dump-guest-memory.py b/scripts/dump-guest-memory.py
4a2fec
index 03fbf69..51acfcd 100644
4a2fec
--- a/scripts/dump-guest-memory.py
4a2fec
+++ b/scripts/dump-guest-memory.py
4a2fec
@@ -546,6 +546,8 @@ shape and this command should mostly work."""
4a2fec
         return None
4a2fec
 
4a2fec
     def add_vmcoreinfo(self):
4a2fec
+        if gdb.lookup_symbol("vmcoreinfo_realize")[0] is None:
4a2fec
+            return
4a2fec
         vmci = 'vmcoreinfo_realize::vmcoreinfo_state'
4a2fec
         if not gdb.parse_and_eval("%s" % vmci) \
4a2fec
            or not gdb.parse_and_eval("(%s)->has_vmcoreinfo" % vmci):
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec