[PATCH v2 02/10] introduce the LOCAL_ACTIVE() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the new simple helper, LOCAL_ACTIVE(). True if crash examines the live kernel
on the same machine.

Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
---
 defs.h    | 1 +
 filesys.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/defs.h b/defs.h
index cc5db51..f31d7f6 100644
--- a/defs.h
+++ b/defs.h
@@ -250,6 +250,7 @@ struct number_option {
 #define PROC_KCORE   (0x8000000000000000ULL)
 
 #define ACTIVE()            (pc->flags & LIVE_SYSTEM)
+#define LOCAL_ACTIVE()      ((pc->flags & LIVE_SYSTEM) && (pc->flags2 & MEMSRC_LOCAL))
 #define DUMPFILE()          (!(pc->flags & LIVE_SYSTEM))
 #define LIVE()              (pc->flags2 & LIVE_DUMP || pc->flags & LIVE_SYSTEM)
 #define MEMORY_SOURCES (NETDUMP|KDUMP|MCLXCD|LKCD|DEVMEM|S390D|MEMMOD|DISKDUMP|XENDUMP|CRASHBUILTIN|KVMDUMP|PROC_KCORE|SADUMP|VMWARE_VMSS)
diff --git a/filesys.c b/filesys.c
index f05a8cd..9ea8f7e 100644
--- a/filesys.c
+++ b/filesys.c
@@ -124,6 +124,7 @@ fd_init(void)
 	
 		if (!pc->dumpfile) {
 			pc->flags |= LIVE_SYSTEM;
+			pc->flags2 |= MEMSRC_LOCAL;
 			get_live_memory_source();
 		}
 	
-- 
2.5.0

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility



[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux