[CRIU] [PATCH 5/8] plugin: add a function to get a descriptor to the image dir

Andrey Vagin avagin at openvz.org
Tue Dec 10 08:25:59 PST 2013


Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/criu-plugin.h | 3 +++
 util.c                | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/include/criu-plugin.h b/include/criu-plugin.h
index 2afb27e..d4ea30c 100644
--- a/include/criu-plugin.h
+++ b/include/criu-plugin.h
@@ -35,6 +35,9 @@ typedef int (cr_plugin_restore_unix_sk_t)(int id);
 extern void print_on_level(unsigned int loglevel, const char *format, ...)
 	__attribute__ ((__format__ (__printf__, 2, 3)));
 
+/* Public API */
+extern int cr_get_image_dir(void);
+
 #define LOG_MSG		(0) /* Print message regardless of log level */
 #define LOG_ERROR	(1) /* Errors only, when we're in trouble */
 #define LOG_WARN	(2) /* Warnings, dazen and confused but trying to continue */
diff --git a/util.c b/util.c
index 0b10f0d..aa53d85 100644
--- a/util.c
+++ b/util.c
@@ -319,6 +319,11 @@ int get_service_fd(enum sfd_type type)
 	return __get_service_fd(type, service_fd_id);
 }
 
+int cr_get_image_dir(void)
+{
+	return get_service_fd(IMG_FD_OFF);
+}
+
 int close_service_fd(enum sfd_type type)
 {
 	int fd;
-- 
1.8.3.1



More information about the CRIU mailing list