pycriu: set RPC opts for CHECK

This allows users to specify RPC options when
using the check() functionality.

Co-authored-by: Andrii Herheliuk <andrii@herheliuk.com>
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
Radostin Stoyanov 2025-10-24 09:28:28 +01:00 committed by Andrei Vagin
parent 9371c4a789
commit f7ccb63bdd

View file

@ -211,7 +211,8 @@ class criu:
def __init__(self):
self.use_binary('criu')
self.opts = rpc.criu_opts()
# images_dir_fd is required field with default value of -1
self.opts = rpc.criu_opts(images_dir_fd=-1)
self.sk = None
def use_sk(self, sk_name=CR_DEFAULT_SERVICE_ADDRESS):
@ -273,6 +274,7 @@ class criu:
"""
req = rpc.criu_req()
req.type = rpc.CHECK
req.opts.MergeFrom(self.opts)
resp = self._send_req_and_recv_resp(req)