[CRIU] [PATCH v6 1/7] image: Rename binfmt_misc image format as "old"

Kirill Tkhai ktkhai at virtuozzo.com
Tue Aug 23 09:16:23 PDT 2016


Also add new format without suffix in file name

v6: New
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/image-desc.c         |    3 ++-
 criu/include/image-desc.h |    1 +
 criu/include/magic.h      |    1 +
 criu/mount.c              |    4 ++--
 4 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/criu/image-desc.c b/criu/image-desc.c
index 2b31354..bac7ca2 100644
--- a/criu/image-desc.c
+++ b/criu/image-desc.c
@@ -79,7 +79,8 @@ struct cr_fd_desc_tmpl imgset_template[CR_FD_MAX] = {
 	FD_ENTRY_F(TMPFS_IMG,	"tmpfs-%d.tar.gz", O_NOBUF),
 	FD_ENTRY_F(TMPFS_DEV,	"tmpfs-dev-%d.tar.gz", O_NOBUF),
 	FD_ENTRY_F(AUTOFS,	"autofs-%d", O_NOBUF),
-	FD_ENTRY(BINFMT_MISC,	"binfmt-misc-%d"),
+	FD_ENTRY(BINFMT_MISC_OLD, "binfmt-misc-%d"),
+	FD_ENTRY(BINFMT_MISC,	"binfmt-misc"),
 	FD_ENTRY(TTY_FILES,	"tty"),
 	FD_ENTRY(TTY_INFO,	"tty-info"),
 	FD_ENTRY_F(TTY_DATA,	"tty-data", O_NOBUF),
diff --git a/criu/include/image-desc.h b/criu/include/image-desc.h
index 7e75ede..bb69616 100644
--- a/criu/include/image-desc.h
+++ b/criu/include/image-desc.h
@@ -86,6 +86,7 @@ enum {
 	CR_FD_TMPFS_IMG,
 	CR_FD_TMPFS_DEV,
 	CR_FD_BINFMT_MISC,
+	CR_FD_BINFMT_MISC_OLD,
 	CR_FD_PAGES,
 
 	CR_FD_VMAS,
diff --git a/criu/include/magic.h b/criu/include/magic.h
index a458c62..deb54b1 100644
--- a/criu/include/magic.h
+++ b/criu/include/magic.h
@@ -107,6 +107,7 @@
 
 #define PAGES_OLD_MAGIC		PAGEMAP_MAGIC
 #define SHM_PAGES_OLD_MAGIC	PAGEMAP_MAGIC
+#define BINFMT_MISC_OLD_MAGIC	BINFMT_MISC_MAGIC
 
 /*
  * These are special files, not exactly images
diff --git a/criu/mount.c b/criu/mount.c
index fe120a1..fb05299 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -1383,7 +1383,7 @@ static int binfmt_misc_dump(struct mount_info *pm)
 	}
 
 	ret = -1;
-	img = open_image(CR_FD_BINFMT_MISC, O_DUMP, pm->s_dev);
+	img = open_image(CR_FD_BINFMT_MISC_OLD, O_DUMP, pm->s_dev);
 	if (!img)
 		goto out;
 
@@ -1497,7 +1497,7 @@ static int binfmt_misc_restore(struct mount_info *mi)
 	if (!buf)
 		return -1;
 
-	img = open_image(CR_FD_BINFMT_MISC, O_RSTR, mi->s_dev);
+	img = open_image(CR_FD_BINFMT_MISC_OLD, O_RSTR, mi->s_dev);
 	if (!img) {
 		goto free_buf;
 	}



More information about the CRIU mailing list