[CRIU] [PATCH 4/7] crtools: don't include image.h in crtools.h

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


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/crtools.h | 14 --------------
 include/image.h   | 13 +++++++++++++
 page-read.c       |  4 ++--
 page-xfer.c       |  1 +
 protobuf.c        |  3 ++-
 stats.c           |  1 +
 6 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/include/crtools.h b/include/crtools.h
index e14828c..669cdb3 100644
--- a/include/crtools.h
+++ b/include/crtools.h
@@ -7,7 +7,6 @@
 #include "asm/types.h"
 #include "list.h"
 #include "util.h"
-#include "image.h"
 #include "lock.h"
 #include "cr-show.h"
 #include "servicefd.h"
@@ -58,15 +57,6 @@ void kill_inventory(void);
 extern void print_data(unsigned long addr, unsigned char *data, size_t size);
 extern void print_image_data(int fd, unsigned int length, int show);
 
-extern int open_image_dir(void);
-extern void close_image_dir(void);
-
-int open_image_at(int dfd, int type, unsigned long flags, ...);
-#define open_image(typ, flags, ...) open_image_at(get_service_fd(IMG_FD_OFF), typ, flags, ##__VA_ARGS__)
-int open_pages_image(unsigned long flags, int pm_fd);
-int open_pages_image_at(int dfd, unsigned long flags, int pm_fd);
-void up_page_ids_base(void);
-
 #define LAST_PID_PATH		"/proc/sys/kernel/ns_last_pid"
 
 int cr_dump_tasks(pid_t pid);
@@ -77,10 +67,6 @@ int convert_to_elf(char *elf_path, int fd_core);
 int cr_check(void);
 int cr_exec(int pid, char **opts);
 
-#define O_DUMP	(O_RDWR | O_CREAT | O_EXCL)
-#define O_SHOW	(O_RDONLY)
-#define O_RSTR	(O_RDONLY)
-
 /*
  * When we have to restore a shared resource, we mush select which
  * task should do it, and make other(s) wait for it. In order to
diff --git a/include/image.h b/include/image.h
index fe6eb91..f38a51b 100644
--- a/include/image.h
+++ b/include/image.h
@@ -63,4 +63,17 @@
 extern bool fdinfo_per_id;
 extern bool ns_per_id;
 
+#define O_DUMP	(O_RDWR | O_CREAT | O_EXCL)
+#define O_SHOW	(O_RDONLY)
+#define O_RSTR	(O_RDONLY)
+
+extern int open_image_dir(void);
+extern void close_image_dir(void);
+
+int open_image_at(int dfd, int type, unsigned long flags, ...);
+#define open_image(typ, flags, ...) open_image_at(get_service_fd(IMG_FD_OFF), typ, flags, ##__VA_ARGS__)
+int open_pages_image(unsigned long flags, int pm_fd);
+int open_pages_image_at(int dfd, unsigned long flags, int pm_fd);
+void up_page_ids_base(void);
+
 #endif /* __CR_IMAGE_H__ */
diff --git a/page-read.c b/page-read.c
index dff6b62..3dde366 100644
--- a/page-read.c
+++ b/page-read.c
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-#include "crtools.h"
+#include "image.h"
 #include "servicefd.h"
 #include "page-read.h"
 
@@ -12,7 +12,7 @@
 static int get_page_vaddr(struct page_read *pr, struct iovec *iov)
 {
 	int ret;
-	__u64 img_va;
+	u64 img_va;
 
 	ret = read_img_eof(pr->fd_pg, &img_va);
 	if (ret <= 0)
diff --git a/page-xfer.c b/page-xfer.c
index 087595f..643285d 100644
--- a/page-xfer.c
+++ b/page-xfer.c
@@ -4,6 +4,7 @@
 #include <unistd.h>
 
 #include "crtools.h"
+#include "image.h"
 #include "page-xfer.h"
 #include "page-pipe.h"
 
diff --git a/protobuf.c b/protobuf.c
index c60886e..885a62f 100644
--- a/protobuf.c
+++ b/protobuf.c
@@ -8,7 +8,8 @@
 
 #include <google/protobuf-c/protobuf-c.h>
 
-#include "crtools.h"
+#include "image.h"
+#include "servicefd.h"
 #include "compiler.h"
 #include "asm/types.h"
 #include "log.h"
diff --git a/stats.c b/stats.c
index af3e574..ed04054 100644
--- a/stats.c
+++ b/stats.c
@@ -3,6 +3,7 @@
 #include "protobuf.h"
 #include "stats.h"
 #include "crtools.h"
+#include "image.h"
 #include "protobuf/stats.pb-c.h"
 
 struct timing {
-- 
1.8.3.1



More information about the CRIU mailing list