[CRIU] [PATCH] image: open lazy images in img_raw_fd()

Andrey Vagin avagin at openvz.org
Mon Mar 16 06:51:06 PDT 2015


Lazy images are opened on a first attempt of using.

00:01:18.534 Test: zdtm/live/static/pipe00, Result: FAIL
00:01:18.537 ==================================== ERROR ====================================
00:01:18.538 Test: zdtm/live/static/pipe00, Namespace: 1
00:01:18.538 Dump log   : /var/lib/jenkins/jobs/CRIU/workspace/test/dump/ns/static/pipe00/13536/1/dump.log
00:01:18.540 --------------------------------- grep Error ---------------------------------
00:01:18.543 (00.026666) Error (include/image.h:153): BUG at include/image.h:153
00:01:18.543 (00.050663) Error (namespaces.c:801): Namespaces dumping finished with error 134
00:01:18.543 (00.050918) Error (cr-dump.c:1979): Dumping FAILED.
00:01:18.545 ------------------------------------- END -------------------------------------
00:01:18.548 ================================= ERROR OVER =================================

Reported-by: Mr Jenkins
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 include/image.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/image.h b/include/image.h
index ce9f95d..9ec0238 100644
--- a/include/image.h
+++ b/include/image.h
@@ -148,8 +148,13 @@ static inline bool lazy_image(struct cr_img *img)
 	return img->_x.fd == LAZY_IMG_FD;
 }
 
+extern int open_image_lazy(struct cr_img *img);
+
 static inline int img_raw_fd(struct cr_img *img)
 {
+	if (lazy_image(img) && open_image_lazy(img))
+		return -1;
+
 	BUG_ON(bfd_buffered(&img->_x));
 	return img->_x.fd;
 }
-- 
1.9.3



More information about the CRIU mailing list