[CRIU] [PATCH 08/15] rst_info: artificial files list introduced

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Dec 3 05:29:25 PST 2015


This list is used to collect and handle some service files, which are used
only during restore procedure for inplementation-dependant operations,
and must be closed before process is released.
Will be used for AutoFS mounts restore.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 files.c            |    8 ++++++++
 include/rst_info.h |    1 +
 2 files changed, 9 insertions(+)

diff --git a/files.c b/files.c
index e6919cd..1679b9f 100644
--- a/files.c
+++ b/files.c
@@ -690,6 +690,7 @@ int prepare_fd_pid(struct pstree_item *item)
 	INIT_LIST_HEAD(&rst_info->eventpoll);
 	INIT_LIST_HEAD(&rst_info->tty_slaves);
 	INIT_LIST_HEAD(&rst_info->tty_ctty);
+	INIT_LIST_HEAD(&rst_info->artificial);
 
 	if (!fdinfo_per_id) {
 		img = open_image(CR_FD_FDINFO, O_RSTR, pid);
@@ -1105,6 +1106,13 @@ int prepare_fds(struct pstree_item *me)
 		ret = open_fdinfos(me->pid.virt, &rsti(me)->eventpoll, state);
 		if (ret)
 			break;
+
+		/* Artificial file descriptors are not transfered within images.
+		 * They are created on restore procedure for some internla
+		 * needs, like Autofs does. */
+		ret = open_fdinfos(me->pid.virt, &rsti(me)->artificial, state);
+		if (ret)
+			break;
 	}
 
 	if (ret)
diff --git a/include/rst_info.h b/include/rst_info.h
index b72e5d0..74e01ee 100644
--- a/include/rst_info.h
+++ b/include/rst_info.h
@@ -31,6 +31,7 @@ struct rst_info {
 	struct list_head	eventpoll;
 	struct list_head	tty_slaves;
 	struct list_head	tty_ctty;
+	struct list_head	artificial;
 
 	void			*premmapped_addr;
 	unsigned long		premmapped_len;



More information about the CRIU mailing list