|
|
9ae3a8 |
From 266135a48594041655e0e2e4b647251bc812670c Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Date: Wed, 13 Dec 2017 13:39:03 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 32/41] kdump: set vmcoreinfo location
|
|
|
9ae3a8 |
MIME-Version: 1.0
|
|
|
9ae3a8 |
Content-Type: text/plain; charset=UTF-8
|
|
|
9ae3a8 |
Content-Transfer-Encoding: 8bit
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20171213133912.26176-33-marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 78383
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.5 qemu-kvm PATCH v3 32/41] kdump: set vmcoreinfo location
|
|
|
9ae3a8 |
Bugzilla: 1411490
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
kdump header provides offset and size of the vmcoreinfo content,
|
|
|
9ae3a8 |
append it if available (skip the ELF note header).
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
crash-7.1.9 was the first version that started looking in the
|
|
|
9ae3a8 |
vmcoreinfo data for phys_base instead of in the kdump_sub_header.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
(cherry picked from commit 9ada575bbafaf6d3724a7f59df9da89776817cac)
|
|
|
9ae3a8 |
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
dump.c | 24 ++++++++++++++++++++++++
|
|
|
9ae3a8 |
1 file changed, 24 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/dump.c b/dump.c
|
|
|
9ae3a8 |
index 3bce730..5aeff02 100644
|
|
|
9ae3a8 |
--- a/dump.c
|
|
|
9ae3a8 |
+++ b/dump.c
|
|
|
9ae3a8 |
@@ -855,6 +855,18 @@ static void create_header32(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
|
|
|
9ae3a8 |
+ if (s->guest_note &&
|
|
|
9ae3a8 |
+ note_name_equal(s, s->guest_note, "VMCOREINFO")) {
|
|
|
9ae3a8 |
+ uint64_t hsize, name_size, size_vmcoreinfo_desc, offset_vmcoreinfo;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ get_note_sizes(s, s->guest_note,
|
|
|
9ae3a8 |
+ &hsize, &name_size, &size_vmcoreinfo_desc);
|
|
|
9ae3a8 |
+ offset_vmcoreinfo = offset_note + s->note_size - s->guest_note_size +
|
|
|
9ae3a8 |
+ (DIV_ROUND_UP(hsize, 4) + DIV_ROUND_UP(name_size, 4)) * 4;
|
|
|
9ae3a8 |
+ kh->offset_vmcoreinfo = cpu_to_dump64(s, offset_vmcoreinfo);
|
|
|
9ae3a8 |
+ kh->size_vmcoreinfo = cpu_to_dump32(s, size_vmcoreinfo_desc);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
kh->offset_note = cpu_to_dump64(s, offset_note);
|
|
|
9ae3a8 |
kh->note_size = cpu_to_dump32(s, s->note_size);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
@@ -955,6 +967,18 @@ static void create_header64(DumpState *s, Error **errp)
|
|
|
9ae3a8 |
kh->dump_level = cpu_to_dump32(s, DUMP_LEVEL);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
offset_note = DISKDUMP_HEADER_BLOCKS * block_size + size;
|
|
|
9ae3a8 |
+ if (s->guest_note &&
|
|
|
9ae3a8 |
+ note_name_equal(s, s->guest_note, "VMCOREINFO")) {
|
|
|
9ae3a8 |
+ uint64_t hsize, name_size, size_vmcoreinfo_desc, offset_vmcoreinfo;
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ get_note_sizes(s, s->guest_note,
|
|
|
9ae3a8 |
+ &hsize, &name_size, &size_vmcoreinfo_desc);
|
|
|
9ae3a8 |
+ offset_vmcoreinfo = offset_note + s->note_size - s->guest_note_size +
|
|
|
9ae3a8 |
+ (DIV_ROUND_UP(hsize, 4) + DIV_ROUND_UP(name_size, 4)) * 4;
|
|
|
9ae3a8 |
+ kh->offset_vmcoreinfo = cpu_to_dump64(s, offset_vmcoreinfo);
|
|
|
9ae3a8 |
+ kh->size_vmcoreinfo = cpu_to_dump64(s, size_vmcoreinfo_desc);
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
kh->offset_note = cpu_to_dump64(s, offset_note);
|
|
|
9ae3a8 |
kh->note_size = cpu_to_dump64(s, s->note_size);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|