[CRIU] [PATCH 4/5] compel/plugins: simplify #includes

Kir Kolyshkin kir at openvz.org
Sat Mar 4 21:42:50 PST 2017


First, for building compel plugins, we already have
"-I compel/include/uapi" in ccflags and asflags, so there is
no need to add "-iquote include/uapi".

Second, let's refer to compel plugin uapi includes in a uniform way,
choosing the same way the external code does, i.e. #include <compel/...>.

Third, in a few cases simplify #include statements by including
compel/plugins/plugin-std.h instead of a number of plugins/std/*.h files.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 compel/plugins/Makefile       | 2 --
 compel/plugins/shmem/shmem.c  | 6 +++---
 compel/plugins/std/fds.c      | 8 ++------
 compel/plugins/std/infect.c   | 7 +------
 compel/plugins/std/std.c      | 4 ++--
 compel/plugins/std/string.c   | 4 ++--
 compel/test/infect/parasite.c | 6 +-----
 7 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index 53321aa..ae3c386 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -19,9 +19,7 @@ ccflags-y		+= -fpie -fno-stack-protector
 
 # General compel/plugins includes
 ccflags-y		+= -iquote $(obj)/include
-ccflags-y		+= -iquote $(obj)/include/uapi
 asflags-y		+= -iquote $(obj)/include
-asflags-y		+= -iquote $(obj)/include/uapi
 
 # Arch compel/plugins includes
 ccflags-y		+= -iquote $(PLUGIN_ARCH_DIR)/include
diff --git a/compel/plugins/shmem/shmem.c b/compel/plugins/shmem/shmem.c
index 9ded93f..1489df6 100644
--- a/compel/plugins/shmem/shmem.c
+++ b/compel/plugins/shmem/shmem.c
@@ -1,8 +1,8 @@
 #include <sys/mman.h>
 
-#include "uapi/plugins.h"
-#include "uapi/plugin-shmem.h"
-#include "uapi/std/syscall.h"
+#include <compel/plugins.h>
+#include <compel/plugins/plugin-shmem.h>
+#include <compel/plugins/std/syscall.h>
 #include "shmem.h"
 #include "std-priv.h"
 
diff --git a/compel/plugins/std/fds.c b/compel/plugins/std/fds.c
index c947a30..eaa1271 100644
--- a/compel/plugins/std/fds.c
+++ b/compel/plugins/std/fds.c
@@ -1,11 +1,7 @@
 #include <errno.h>
 
-#include "uapi/plugins.h"
-
-#include "uapi/std/syscall.h"
-#include "uapi/std/string.h"
-#include "uapi/std/log.h"
-#include "uapi/std/fds.h"
+#include <compel/plugins.h>
+#include <compel/plugins/plugin-std.h>
 
 #include "std-priv.h"
 
diff --git a/compel/plugins/std/infect.c b/compel/plugins/std/infect.c
index a9553c8..5f195f1 100644
--- a/compel/plugins/std/infect.c
+++ b/compel/plugins/std/infect.c
@@ -1,11 +1,6 @@
-#include <compel/plugins/std/syscall.h>
-#include <compel/plugins/std/infect.h>
+#include <compel/plugins/plugin-std.h>
 
 #include "common/scm.h"
-#include "uapi/compel/plugins/std/fds.h"
-#include "uapi/compel/plugins/std/string.h"
-#include "uapi/compel/plugins/std/log.h"
-
 #include "common/compiler.h"
 #include "common/lock.h"
 
diff --git a/compel/plugins/std/std.c b/compel/plugins/std/std.c
index e326ef7..ec04665 100644
--- a/compel/plugins/std/std.c
+++ b/compel/plugins/std/std.c
@@ -1,7 +1,7 @@
 #include <sys/types.h>
 
-#include "uapi/plugins.h"
-#include "uapi/plugin-std.h"
+#include <compel/plugins.h>
+#include <compel/plugins/plugin-std.h>
 
 #include "asm/prologue.h"
 
diff --git a/compel/plugins/std/string.c b/compel/plugins/std/string.c
index 43db1e3..85bede8 100644
--- a/compel/plugins/std/string.c
+++ b/compel/plugins/std/string.c
@@ -2,8 +2,8 @@
 #include <stdbool.h>
 #include <stdarg.h>
 
-#include "uapi/std/syscall.h"
-#include "uapi/std/string.h"
+#include <compel/plugins/std/syscall.h>
+#include <compel/plugins/std/string.h>
 
 #include "features.h"
 
diff --git a/compel/test/infect/parasite.c b/compel/test/infect/parasite.c
index 68bf1f7..17bf3d6 100644
--- a/compel/test/infect/parasite.c
+++ b/compel/test/infect/parasite.c
@@ -1,10 +1,6 @@
 #include <errno.h>
 
-#include <compel/plugins/std/syscall.h>
-#include <compel/plugins/std/string.h>
-#include <compel/plugins/std/log.h>
-
-#include <compel/infect-rpc.h>
+#include <compel/plugins/plugin-std.h>
 
 /*
  * Stubs for std compel plugin.
-- 
2.9.3



More information about the CRIU mailing list