[CRIU] [PATCH] Allow dumping of pstore, securityfs, fusectl, debugfs

Tycho Andersen tycho.andersen at canonical.com
Mon Jun 9 09:04:07 PDT 2014


These are mounted by default in ubuntu containers, so criu should know about
them and remount them on restore.
---
 mount.c            | 28 ++++++++++++++++++++++++++++
 protobuf/mnt.proto |  4 ++++
 2 files changed, 32 insertions(+)

diff --git a/mount.c b/mount.c
index d770e14..5415236 100644
--- a/mount.c
+++ b/mount.c
@@ -706,6 +706,18 @@ out:
 	return ret;
 }
 
+#define MK_MOUNT_LOG(IMG_TYPE, FNAME) 					\
+	static int FNAME##_dump(struct mount_info *pm) 			\
+	{								\
+		pr_info("logging mount of %s\n", pm->fstype->name);	\
+		return 0;						\
+	}
+
+MK_MOUNT_LOG(CR_FD_PSTORE_IMG, pstore)
+MK_MOUNT_LOG(CR_FD_SECURITYFS_IMG, securityfs)
+MK_MOUNT_LOG(CR_FD_FUSECTL_IMG, fusectl)
+MK_MOUNT_LOG(CR_FD_DEBUGFS_IMG, debugfs)
+
 static struct fstype fstypes[] = {
 	{
 		.name = "unsupported",
@@ -738,6 +750,22 @@ static struct fstype fstypes[] = {
 	}, {
 		.name = "btrfs",
 		.code = FSTYPE__UNSUPPORTED,
+	}, {
+		.name = "pstore",
+		.dump = pstore_dump,
+		.code = FSTYPE__PSTORE,
+	}, {
+		.name = "securityfs",
+		.dump = securityfs_dump,
+		.code = FSTYPE__SECURITYFS,
+	}, {
+		.name = "fusectl",
+		.dump = fusectl_dump,
+		.code = FSTYPE__FUSECTL,
+	}, {
+		.name = "debugfs",
+		.dump = debugfs_dump,
+		.code = FSTYPE__DEBUGFS,
 	}
 };
 
diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
index ab85de7..297bcbd 100644
--- a/protobuf/mnt.proto
+++ b/protobuf/mnt.proto
@@ -7,6 +7,10 @@ enum fstype {
 	TMPFS			= 5;
 	DEVPTS			= 6;
 	SIMFS			= 7;
+	PSTORE			= 8;
+	SECURITYFS		= 9;
+	FUSECTL			= 10;
+	DEBUGFS			= 11;
 };
 
 message mnt_entry {
-- 
1.9.1



More information about the CRIU mailing list