[CRIU] [PATCH] show: read a second magic when it's required

Andrey Vagin avagin at openvz.org
Mon Apr 20 05:58:28 PDT 2015


Now image files contains two magics, so we need to handle both of them.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-show.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cr-show.c b/cr-show.c
index 9703a5a..5855bf4 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -380,6 +380,11 @@ int cr_parse_fd(struct cr_img *img, u32 magic)
 {
 	int ret = 0, i;
 
+	if (magic == IMG_COMMON_MAGIC || magic == IMG_SERVICE_MAGIC) {
+		if (read_img(img, &magic) < 0)
+			goto out;
+	}
+
 	if (magic == PSTREE_MAGIC) {
 		show_collect_pstree(img, 0);
 		goto out;
-- 
2.1.0



More information about the CRIU mailing list