[CRIU] [PATCH 6/6] compel: plugins -- Merge fds plugin into std

Cyrill Gorcunov gorcunov at openvz.org
Fri Nov 25 07:11:56 PST 2016


We use fds helpers in std plugin anyway
so just merge it in.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 compel/plugins/Makefile                  | 11 ++---------
 compel/plugins/include/uapi/plugin-fds.h | 12 ------------
 compel/plugins/include/uapi/plugin-std.h |  1 +
 compel/plugins/include/uapi/std/fds.h    |  8 ++++++++
 compel/plugins/{fds => std}/fds.c        |  4 +---
 compel/plugins/std/infect.c              |  2 +-
 compel/src/lib/infect-util.c             |  2 +-
 compel/test/infect/Makefile              |  3 +--
 8 files changed, 15 insertions(+), 28 deletions(-)
 delete mode 100644 compel/plugins/include/uapi/plugin-fds.h
 create mode 100644 compel/plugins/include/uapi/std/fds.h
 rename compel/plugins/{fds => std}/fds.c (85%)

diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
index 320f55853678..80735558cb64 100644
--- a/compel/plugins/Makefile
+++ b/compel/plugins/Makefile
@@ -35,11 +35,6 @@ asflags-y		+= -fno-stack-protector
 ldflags-y		+= -z noexecstack
 
 #
-# Fds plugin
-target			+= fds
-fds-obj-y		+= fds/fds.o
-
-#
 # Shmem plugin
 target			+= shmem
 shmem-obj-y		+= shmem/shmem.o
@@ -48,6 +43,7 @@ shmem-obj-y		+= shmem/shmem.o
 # STD plugin
 target			+= std
 std-obj-y		+= std/std.o
+std-obj-y		+= std/fds.o
 std-obj-y		+= std/log.o
 std-obj-y		+= std/string.o
 std-obj-y		+= std/infect.o
@@ -71,11 +67,10 @@ $(foreach t,$(target),$(eval $(call syscall-priority,$(t)-obj-y,std-headers-deps
 #
 # FIXME syscall-types.h should be setup earlier
 #
-install: compel/plugins/std.built-in.o compel/plugins/fds.built-in.o
+install: compel/plugins/std.built-in.o
 	$(E) "  INSTALL " compel plugins
 	$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/compel/
 	$(Q) install -m 0644 compel/plugins/std.built-in.o $(DESTDIR)$(LIBEXECDIR)/compel/
-	$(Q) install -m 0644 compel/plugins/fds.built-in.o $(DESTDIR)$(LIBEXECDIR)/compel/
 	$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/compel/scripts
 	$(Q) install -m 0644 compel/arch/$(ARCH)/scripts/compel-pack.lds.S $(DESTDIR)$(LIBEXECDIR)/compel/scripts
 	$(E) "  INSTALL " compel plugins uapi
@@ -83,13 +78,11 @@ install: compel/plugins/std.built-in.o compel/plugins/fds.built-in.o
 	$(Q) cp -fr compel/include/uapi/compel/plugins/plugin-std.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins
 	$(Q) cp -fr compel/include/uapi/compel/plugins/std/*.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins/std
 	$(Q) cp -fr compel/arch/$(ARCH)/plugins/include/asm/syscall-types.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins/std/asm
-	$(Q) cp -fr compel/include/uapi/compel/plugins/plugin-fds.h $(DESTDIR)$(INCLUDEDIR)/compel/plugins
 .PHONY: install
 
 uninstall:
 	$(E) " UNINSTALL" compel plugins
 	$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBEXECDIR)/compel/,std.built-in.o)
-	$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBEXECDIR)/compel/,fds.built-in.o)
 	$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBEXECDIR)/compel/scripts,compel-pack.lds.S)
 	$(E) " UNINSTALL" compel and plugins uapi
 	$(Q) $(RM) -rf $(addprefix $(DESTDIR)$(INCLUDEDIR),compel/plugins)
diff --git a/compel/plugins/include/uapi/plugin-fds.h b/compel/plugins/include/uapi/plugin-fds.h
deleted file mode 100644
index fbf5313a81be..000000000000
--- a/compel/plugins/include/uapi/plugin-fds.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * plugin-fds.h -- API for fds compel plugin
- */
-
-#ifndef __COMPEL_PLUGIN_FDS_H__
-#define __COMPEL_PLUGIN_FDS_H__
-
-#include <sys/un.h>
-
-#include <compel/common/scm.h>
-
-#endif /* __COMPEL_PLUGIN_FDS_H__ */
diff --git a/compel/plugins/include/uapi/plugin-std.h b/compel/plugins/include/uapi/plugin-std.h
index 29e6c1b119d5..78619ecd75ad 100644
--- a/compel/plugins/include/uapi/plugin-std.h
+++ b/compel/plugins/include/uapi/plugin-std.h
@@ -5,5 +5,6 @@
 #include <compel/plugins/std/syscall.h>
 #include <compel/plugins/std/string.h>
 #include <compel/plugins/std/infect.h>
+#include <compel/plugins/std/fds.h>
 
 #endif /* COMPEL_PLUGIN_STD_STD_H__ */
diff --git a/compel/plugins/include/uapi/std/fds.h b/compel/plugins/include/uapi/std/fds.h
new file mode 100644
index 000000000000..e25c4da9a7f8
--- /dev/null
+++ b/compel/plugins/include/uapi/std/fds.h
@@ -0,0 +1,8 @@
+#ifndef COMPEL_PLUGIN_STD_FDS_H__
+#define COMPEL_PLUGIN_STD_FDS_H__
+
+#include <sys/un.h>
+
+#include <compel/common/scm.h>
+
+#endif /* COMPEL_PLUGIN_STD_FDS_H__ */
diff --git a/compel/plugins/fds/fds.c b/compel/plugins/std/fds.c
similarity index 85%
rename from compel/plugins/fds/fds.c
rename to compel/plugins/std/fds.c
index 28f1db7482ee..8cfe6d288d5c 100644
--- a/compel/plugins/fds/fds.c
+++ b/compel/plugins/std/fds.c
@@ -5,7 +5,7 @@
 #include "uapi/std/syscall.h"
 #include "uapi/std/string.h"
 #include "uapi/std/log.h"
-#include "uapi/plugin-fds.h"
+#include "uapi/std/fds.h"
 
 #include "std-priv.h"
 
@@ -18,5 +18,3 @@
 #define __memcpy	std_memcpy
 
 #include "common/scm-code.c"
-
-PLUGIN_REGISTER_DUMMY(fds)
diff --git a/compel/plugins/std/infect.c b/compel/plugins/std/infect.c
index 4d06814516c4..b84ca02138e1 100644
--- a/compel/plugins/std/infect.c
+++ b/compel/plugins/std/infect.c
@@ -3,7 +3,7 @@
 
 #define SCM_FDSET_HAS_OPTS
 #include "common/scm.h"
-#include "uapi/compel/plugins/plugin-fds.h"
+#include "uapi/compel/plugins/std/fds.h"
 #include "uapi/compel/plugins/std/string.h"
 #include "uapi/compel/plugins/std/log.h"
 
diff --git a/compel/src/lib/infect-util.c b/compel/src/lib/infect-util.c
index 99dbee0629d7..b8f20bf010f4 100644
--- a/compel/src/lib/infect-util.c
+++ b/compel/src/lib/infect-util.c
@@ -2,7 +2,7 @@
 #include "common/bug.h"
 #include "common/lock.h"
 
-#include "uapi/compel/plugins/plugin-fds.h"
+#include "uapi/compel/plugins/std/fds.h"
 
 #include "infect-rpc.h"
 #include "infect-util.h"
diff --git a/compel/test/infect/Makefile b/compel/test/infect/Makefile
index fa05b6565587..abe84638d000 100644
--- a/compel/test/infect/Makefile
+++ b/compel/test/infect/Makefile
@@ -32,8 +32,7 @@ parasite.h: parasite.po
 		-u $(COMPEL_IDIR)		\
 		-o $@
 
-# FIXME -- fds.plugin.o isn't generated automatically
-parasite.po: parasite.o $(COMPEL_PLUGINS)/std.built-in.o $(COMPEL_PLUGINS)/fds.built-in.o
+parasite.po: parasite.o $(COMPEL_PLUGINS)/std.built-in.o
 	ld -r -T $(COMPEL_PACK_LDS) -o $@ $^
 
 parasite.o: parasite.c
-- 
2.7.4



More information about the CRIU mailing list