Skip to contentSkip to conversation

kexec-tools: Minor Xen fixes and cleanups

PATCH In review Daniel Kiper 2 participants 7 messages Dec 2, 2013 – Dec 3, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover kexec-tools: Minor Xen fixes and cleanups

Hi,

This patch series contains following minor Xen fixes and cleanups for kexec-tools:
- kexec-tools/xen: Do not call xc_interface_close() if xc_interface_open() failed,
- kexec-tools/xen: Remove redundant include.

Please apply.

Daniel

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#1 lore raw

PATCH 1/2 kexec-tools/xen: Do not call xc_interface_close() if xc_interface_open() failed

Do not call xc_interface_close() if xc_interface_open() failed. xc_interface_close() crashes if it gets NULL as an argument. Relevant fix for libxenctrl will be posted too but kexec-tools should also behave properly.

---
 kexec/arch/i386/crashdump-x86.c    |    2 +-
 kexec/arch/i386/kexec-x86-common.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -1
index 85f3a87..a3eb5ae 100644
@@ -305,7 +305,7 @@ static int get_crash_memory_ranges_xen(struct memory_range **range,
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, CRASH_MAX_MEMORY_RANGES);
kexec/arch/i386/kexec-x86-common.c +1 -1
index bf58f53..f55e2c2 100644
@@ -176,7 +176,7 @@ static int get_memory_ranges_xen(struct memory_range **range, int *ranges)
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, MAX_MEMORY_RANGES);
Signature · 1 line
1.7.10.4
#2 lore raw

PATCH 1/2 kexec-tools/xen: Do not call xc_interface_close() if xc_interface_open() failed

In reply to Daniel Kiper

Do not call xc_interface_close() if xc_interface_open() failed. xc_interface_close() crashes if it gets NULL as an argument. Relevant fix for libxenctrl will be posted too but kexec-tools should also behave properly.

---
 kexec/arch/i386/crashdump-x86.c    |    2 +-
 kexec/arch/i386/kexec-x86-common.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -1
index 85f3a87..a3eb5ae 100644
@@ -305,7 +305,7 @@ static int get_crash_memory_ranges_xen(struct memory_range **range,
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, CRASH_MAX_MEMORY_RANGES);
kexec/arch/i386/kexec-x86-common.c +1 -1
index bf58f53..f55e2c2 100644
@@ -176,7 +176,7 @@ static int get_memory_ranges_xen(struct memory_range **range, int *ranges)
 
 	if (!xc) {
 		fprintf(stderr, "%s: Failed to open Xen control interface\n", __func__);
-		goto err;
+		return -1;
 	}
 
 	rc = xc_get_machine_memory_map(xc, e820entries, MAX_MEMORY_RANGES);
Signature · 7 lines
1.7.10.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw

PATCH 2/2 kexec-tools/xen: Remove redundant include

In reply to Daniel Kiper

Remove redundant include of stdlib.h introduced by commit d01680c28ba7bf1e02f74aa5841247a45738f5d4 (kexec/xen: Correct some compile errors).

---
 kexec/kexec-xen.c |    1 -
 1 file changed, 1 deletion(-)
kexec/kexec-xen.c +0 -1
index e885246..cac313d 100644
@@ -2,7 +2,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <stdlib.h>
 #include <elf.h>
 #include "kexec.h"
 #include "kexec-syscall.h"
Signature · 1 line
1.7.10.4
#4 lore raw

PATCH 2/2 kexec-tools/xen: Remove redundant include

In reply to Daniel Kiper

Remove redundant include of stdlib.h introduced by commit d01680c28ba7bf1e02f74aa5841247a45738f5d4 (kexec/xen: Correct some compile errors).

---
 kexec/kexec-xen.c |    1 -
 1 file changed, 1 deletion(-)
kexec/kexec-xen.c +0 -1
index e885246..cac313d 100644
@@ -2,7 +2,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <stdlib.h>
 #include <elf.h>
 #include "kexec.h"
 #include "kexec-syscall.h"
Signature · 7 lines
1.7.10.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#5 lore raw
In reply to Daniel Kiper
Quoted 7 lines · Daniel Kiper

Hi,

This patch series contains following minor Xen fixes and cleanups for kexec-tools:
- kexec-tools/xen: Do not call xc_interface_close() if xc_interface_open() failed,
- kexec-tools/xen: Remove redundant include.

Please apply.

Thanks, both applied.