Commit 6794c8c2 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

compel: Add fds plugin (v2)

This is just export by reasonable name of the existing
code, that sends and receives FDs via compel RPC socket.

v2:
 Rebase on recent criu-dev
 Fix parallel build
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b502d7fd
......@@ -22,7 +22,7 @@ compel-deps += compel/include/asm
compel-deps += $(COMPEL_VERSION_HEADER)
compel-deps += $(CONFIG_HEADER)
compel-deps += include/common/asm
compel-plugins += compel/plugins/std.built-in.o
compel-plugins += compel/plugins/std.built-in.o compel/plugins/fds.built-in.o
LIBCOMPEL_SO := libcompel.so
LIBCOMPEL_A := libcompel.a
......@@ -50,7 +50,10 @@ compel/plugins/%: $(compel-deps) .FORCE
compel/plugins/std.built-in.o: $(compel-deps) .FORCE
$(Q) $(MAKE) $(build)=compel/plugins $@
compel/plugins/shmem.built-in.o: $(compel-deps) .FORCE
compel/plugins/shmem.built-in.o: $(compel-deps) compel/plugins/std.built-in.o .FORCE
$(Q) $(MAKE) $(build)=compel/plugins $@
compel/plugins/fds.built-in.o: $(compel-deps) compel/plugins/std.built-in.o .FORCE
$(Q) $(MAKE) $(build)=compel/plugins $@
compel/compel: compel/built-in.o compel/$(LIBCOMPEL_A) | $(compel-deps)
......
......@@ -48,6 +48,11 @@ std-obj-y += std/string.o
std-obj-y += std/infect.o
std-obj-y += ./$(PLUGIN_ARCH_DIR)/std/parasite-head.o
#
# FDS plugin
target += fds
fds-obj-y += fds/fds.o
ifeq ($(SRCARCH),x86)
std-obj-y += ./$(PLUGIN_ARCH_DIR)/std/memcpy.o
endif
......
#include <errno.h>
#include "uapi/plugins.h"
#include "uapi/plugins/std.h"
#include <compel/plugins/std/infect.h>
#define pr_err(fmt, ...)
#include "common/compiler.h"
#include "common/bug.h"
#define __sys(foo) sys_##foo
#define __sys_err(ret) ret
#include "common/scm.h"
int fds_send_fd(int fd)
{
return send_fd(parasite_get_rpc_sock(), NULL, 0, fd);
}
int fds_recv_fd(void)
{
return recv_fd(parasite_get_rpc_sock());
}
#ifndef COMPEL_PLUGIN_STD_STD_H__
#define COMPEL_PLUGIN_STD_STD_H__
extern int fds_send_fd(int fd);
extern int fds_recv_fd(void);
#endif /* COMPEL_PLUGIN_STD_STD_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment