[CRIU] [PATCH 1/7] crtools: don't include pstree.h in parasite-syscall.h

Andrey Vagin avagin at openvz.org
Wed Nov 6 02:34:27 PST 2013


pstree and parasite are two different subsystems, so it "should" not
depend on each other.

parasite-syscall uses the pid struct, so this patch moves it in a
separate header.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/parasite-syscall.h |  5 +++--
 include/pid.h              | 20 ++++++++++++++++++++
 include/pstree.h           | 17 +----------------
 3 files changed, 24 insertions(+), 18 deletions(-)
 create mode 100644 include/pid.h

diff --git a/include/parasite-syscall.h b/include/parasite-syscall.h
index fc2d755..562935c 100644
--- a/include/parasite-syscall.h
+++ b/include/parasite-syscall.h
@@ -1,9 +1,10 @@
 #ifndef __CR_PARASITE_SYSCALL_H__
 #define __CR_PARASITE_SYSCALL_H__
 
-#define BUILTIN_SYSCALL_SIZE	8
+#include "pid.h"
+#include "list.h"
 
-#include "pstree.h"
+#define BUILTIN_SYSCALL_SIZE	8
 
 struct parasite_dump_thread;
 struct parasite_dump_misc;
diff --git a/include/pid.h b/include/pid.h
new file mode 100644
index 0000000..42a2b7e
--- /dev/null
+++ b/include/pid.h
@@ -0,0 +1,20 @@
+#ifndef __CR_PID_H__
+#define __CR_PID_H__
+
+struct pid {
+	/*
+	 * The @real pid is used to fetch tasks during dumping stage,
+	 * This is a global pid seen from the context where the dumping
+	 * is running.
+	 */
+	pid_t real;
+
+	/*
+	 * The @virt pid is one which used in the image itself and keeps
+	 * the pid value to be restored. This pid fetched from the
+	 * dumpee context, because the dumpee might have own pid namespace.
+	 */
+	pid_t virt;
+};
+
+#endif
diff --git a/include/pstree.h b/include/pstree.h
index 20bacb7..698e582 100644
--- a/include/pstree.h
+++ b/include/pstree.h
@@ -2,6 +2,7 @@
 #define __CR_PSTREE_H__
 
 #include "list.h"
+#include "pid.h"
 #include "crtools.h"
 #include "protobuf/core.pb-c.h"
 
@@ -11,22 +12,6 @@
  */
 #define INIT_PID	(1)
 
-struct pid {
-	/*
-	 * The @real pid is used to fetch tasks during dumping stage,
-	 * This is a global pid seen from the context where the dumping
-	 * is running.
-	 */
-	pid_t real;
-
-	/*
-	 * The @virt pid is one which used in the image itself and keeps
-	 * the pid value to be restored. This pid fetched from the
-	 * dumpee context, because the dumpee might have own pid namespace.
-	 */
-	pid_t virt;
-};
-
 struct pstree_item {
 	struct pstree_item	*parent;
 	struct list_head	children;	/* list of my children */
-- 
1.8.3.1



More information about the CRIU mailing list