File kdumpid-fix-kdump_is_xen.patch of Package kdumpid

Date: Tue Nov 4 11:20:28 2014 +0100
From: Petr Tesarik <petr@tesarici.cz>
Subject: Fix wrong usage of kdump_is_xen()
Patch-mainline: v1.1
Git-commit: a557c16904df5ca29eec27494c43470e662fb8e7

Fix a regression from commit e1a8f69a238f1efa2dc1e693513c1366912ffe0e.
The whole expression "dd->flags & DIF_XEN" is equivallent to
"kdump_is_xen(dd->ctx)". Performing a logical AND operation with
the program flags only causes random failures.

Signed-off-by: Petr Tesarik <petr@tesarici.cz>

---
 util.c |    2 +-
 x86.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/util.c
+++ b/util.c
@@ -228,7 +228,7 @@ explore_kernel(struct dump_desc *dd, exp
 	if (arch_in_array(dd->arch, x86_biarch)) {
 		/* Xen pv kernels are loaded low */
 		addr = 0x2000;
-		if (dd->flags & kdump_is_xen(dd->ctx) &&
+		if (kdump_is_xen(dd->ctx) &&
 		    looks_like_kcode_x86(dd, addr) > 0 &&
 		    !fn(dd, addr, addr + MAX_KERNEL_SIZE, x86_biarch)) {
 			dd->start_addr = addr;
--- a/x86.c
+++ b/x86.c
@@ -218,7 +218,7 @@ disas_at(struct dump_desc *dd, struct di
 				return 1;
 			if (is_reg(arg1, "si")) {
 				state.flags |= SI_STORED;
-				if (dd->flags & kdump_is_xen(dd->ctx) &&
+				if (kdump_is_xen(dd->ctx) &&
 				    !(state.flags & SI_MODIFIED) &&
 				    sscanf(arg2, "0x%llx", &a) == 1)
 					dd->xen_start_info = a;
openSUSE Build Service is sponsored by