[CRIU] [PATCH 27/38] compel: Move infect-rpc.h into compel
Cyrill Gorcunov
gorcunov at openvz.org
Tue Oct 11 09:04:17 PDT 2016
- to validate inclusion paths
- beautify the header
- start moving criu infectstuff into compel
Note the infect-rpc.o is still sitting in criu code
because inveaving types spread over criu is a big
chunk of work.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
compel/include/compel/infect-rpc.h | 20 ++++++++++++++++++++
criu/aio.c | 2 +-
criu/include/infect-rpc.h | 20 --------------------
criu/infect-rpc.c | 2 +-
criu/infect.c | 2 +-
criu/mem.c | 2 +-
criu/parasite-syscall.c | 2 +-
criu/pie/parasite.c | 2 +-
criu/vdso.c | 2 +-
9 files changed, 27 insertions(+), 27 deletions(-)
create mode 100644 compel/include/compel/infect-rpc.h
delete mode 100644 criu/include/infect-rpc.h
diff --git a/compel/include/compel/infect-rpc.h b/compel/include/compel/infect-rpc.h
new file mode 100644
index 000000000000..11e00bd6aa3b
--- /dev/null
+++ b/compel/include/compel/infect-rpc.h
@@ -0,0 +1,20 @@
+#ifndef COMPEL_INFECT_RPC_H__
+#define COMPEL_INFECT_RPC_H__
+
+#include <stdint.h>
+
+extern int compel_rpc_sync(unsigned int cmd, struct parasite_ctl *ctl);
+extern int compel_rpc_call(unsigned int cmd, struct parasite_ctl *ctl);
+extern int compel_rpc_call_sync(unsigned int cmd, struct parasite_ctl *ctl);
+extern int compel_rpc_sock(struct parasite_ctl *ctl);
+
+struct ctl_msg {
+ uint32_t cmd; /* command itself */
+ uint32_t ack; /* ack on command */
+ uint32_t err; /* error code on reply */
+};
+
+#define ctl_msg_cmd(_cmd) (struct ctl_msg){ .cmd = _cmd, }
+#define ctl_msg_ack(_cmd, _err) (struct ctl_msg){ .cmd = _cmd, .ack = _cmd, .err = _err, }
+
+#endif /* COMPEL_INFECT_RPC_H__ */
diff --git a/criu/aio.c b/criu/aio.c
index 011a1afcf135..ea65f146c8e0 100644
--- a/criu/aio.c
+++ b/criu/aio.c
@@ -12,7 +12,7 @@
#include "parasite-syscall.h"
#include "images/mm.pb-c.h"
#include "infect.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
#define NR_IOEVENTS_IN_NPAGES(npages) ((PAGE_SIZE * npages - sizeof(struct aio_ring)) / sizeof(struct io_event))
diff --git a/criu/include/infect-rpc.h b/criu/include/infect-rpc.h
deleted file mode 100644
index fd03a096721a..000000000000
--- a/criu/include/infect-rpc.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef __COMPEL_INFECT_RPC_H__
-#define __COMPEL_INFECT_RPC_H__
-extern int compel_rpc_sync(unsigned int cmd, struct parasite_ctl *ctl);
-extern int compel_rpc_call(unsigned int cmd, struct parasite_ctl *ctl);
-extern int compel_rpc_call_sync(unsigned int cmd, struct parasite_ctl *ctl);
-extern int compel_rpc_sock(struct parasite_ctl *ctl);
-
-struct ctl_msg {
- u32 cmd; /* command itself */
- u32 ack; /* ack on command */
- s32 err; /* error code on reply */
-};
-
-#define ctl_msg_cmd(_cmd) \
- (struct ctl_msg){.cmd = _cmd, }
-
-#define ctl_msg_ack(_cmd, _err) \
- (struct ctl_msg){.cmd = _cmd, .ack = _cmd, .err = _err, }
-
-#endif
diff --git a/criu/infect-rpc.c b/criu/infect-rpc.c
index 0084495acbcf..12225e3ca1c7 100644
--- a/criu/infect-rpc.c
+++ b/criu/infect-rpc.c
@@ -3,7 +3,7 @@
#include "parasite-syscall.h"
#include "infect.h"
#include "infect-priv.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
static int __parasite_send_cmd(int sockfd, struct ctl_msg *m)
{
diff --git a/criu/infect.c b/criu/infect.c
index 678b521623e8..c3df5d44b5e4 100644
--- a/criu/infect.c
+++ b/criu/infect.c
@@ -18,7 +18,7 @@
#include "sigframe.h"
#include "log.h"
#include "infect.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
#include "infect-priv.h"
#define MEMFD_FNAME "CRIUMFD"
diff --git a/criu/mem.c b/criu/mem.c
index 5e3628de7078..d8cde05064f8 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -27,7 +27,7 @@
#include "pagemap-cache.h"
#include "fault-injection.h"
#include "infect.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
#include "protobuf.h"
#include "images/pagemap.pb-c.h"
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 57f4d2deb6b4..a001cfafb7f8 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -42,7 +42,7 @@
#include "pie/pie-relocs.h"
#include "infect.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
unsigned long get_exec_start(struct vm_area_list *vmas)
{
diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index faf0cf91f7b2..4d2698231363 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -17,7 +17,7 @@
#include "log.h"
#include "tty.h"
#include "aio.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
#include "asm/types.h"
#include "asm/parasite.h"
diff --git a/criu/vdso.c b/criu/vdso.c
index 41df3c9b0e57..19a0274e8562 100644
--- a/criu/vdso.c
+++ b/criu/vdso.c
@@ -22,7 +22,7 @@
#include "mem.h"
#include "vma.h"
#include "infect.h"
-#include "infect-rpc.h"
+#include "compel/infect-rpc.h"
#ifdef LOG_PREFIX
# undef LOG_PREFIX
--
2.7.4
More information about the CRIU
mailing list