[CRIU] [PATCH 5/8] plugin: add a function to get a descriptor to the image dir
Andrey Vagin
avagin at openvz.org
Mon Dec 16 03:26:43 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 e8661b3..14e1989 100644
--- a/include/criu-plugin.h
+++ b/include/criu-plugin.h
@@ -32,6 +32,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 criu_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..90b6d33 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 criu_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