[CRIU] [PATCH 01/10] ns: Introduce collect_namespaces routine
Pavel Emelyanov
xemul at parallels.com
Mon Sep 29 11:03:42 PDT 2014
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
cr-dump.c | 2 +-
include/namespaces.h | 1 +
namespaces.c | 11 +++++++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/cr-dump.c b/cr-dump.c
index 04c18fa..03f107d 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1796,7 +1796,7 @@ int cr_dump_tasks(pid_t pid)
if (collect_file_locks())
goto err;
- if (collect_mnt_namespaces() < 0)
+ if (collect_namespaces() < 0)
goto err;
if (collect_sockets(pid))
diff --git a/include/namespaces.h b/include/namespaces.h
index ccf55f8..83fba9a 100644
--- a/include/namespaces.h
+++ b/include/namespaces.h
@@ -41,6 +41,7 @@ extern unsigned long root_ns_mask;
extern const struct fdtype_ops nsfile_dump_ops;
extern struct collect_image_info nsfile_cinfo;
+extern int collect_namespaces(void);
extern int collect_mnt_namespaces(void);
extern int dump_mnt_namespaces(void);
extern int dump_namespaces(struct pstree_item *item, unsigned int ns_flags);
diff --git a/namespaces.c b/namespaces.c
index 8021cff..b900a3a 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -520,6 +520,17 @@ int dump_namespaces(struct pstree_item *item, unsigned int ns_flags)
return 0;
}
+int collect_namespaces(void)
+{
+ int ret;
+
+ ret = collect_mnt_namespaces();
+ if (ret < 0)
+ return ret;
+
+ return 0;
+}
+
int prepare_namespace(struct pstree_item *item, unsigned long clone_flags)
{
pid_t pid = item->pid.virt;
--
1.8.4.2
More information about the CRIU
mailing list