Skip to content

Commit b5caafc

Browse files
committed
pycriu: making images_dir_fd optional
Since `images_dir_fd` is a required filed in `rpc.proto` we must manually set it to `-1` in order to use `images_dir`. Fix this by explicitly assigning `images_dir_fd` the value from `opts` so it happens automatically. Signed-off-by: Andrii Herheliuk <[email protected]>
1 parent 57251d8 commit b5caafc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/pycriu/criu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ def dump(self):
278278
req = rpc.criu_req()
279279
req.type = rpc.DUMP
280280
req.opts.MergeFrom(self.opts)
281+
req.opts.images_dir_fd = self.opts.images_dir_fd
281282

282283
resp = self._send_req_and_recv_resp(req)
283284

@@ -293,6 +294,7 @@ def pre_dump(self):
293294
req = rpc.criu_req()
294295
req.type = rpc.PRE_DUMP
295296
req.opts.MergeFrom(self.opts)
297+
req.opts.images_dir_fd = self.opts.images_dir_fd
296298

297299
resp = self._send_req_and_recv_resp(req)
298300

@@ -308,6 +310,7 @@ def restore(self):
308310
req = rpc.criu_req()
309311
req.type = rpc.RESTORE
310312
req.opts.MergeFrom(self.opts)
313+
req.opts.images_dir_fd = self.opts.images_dir_fd
311314

312315
resp = self._send_req_and_recv_resp(req)
313316

@@ -320,6 +323,7 @@ def page_server_chld(self):
320323
req = rpc.criu_req()
321324
req.type = rpc.PAGE_SERVER_CHLD
322325
req.opts.MergeFrom(self.opts)
326+
req.opts.images_dir_fd = self.opts.images_dir_fd
323327
req.keep_open = True
324328

325329
resp = self._send_req_and_recv_resp(req)

0 commit comments

Comments
 (0)