Skip to content

Conversation

@herheliuk
Copy link
Member

Currently, using images_dir requires explicitly setting opts.images_dir_fd to -1 for every
request
, because Protobuf treats the field as required, even though its default value is already -1.

This makes the field unnecessarily mandatory.

Signed-off-by: Andrii Herheliuk andrii@herheliuk.com

Currently, using `images_dir` requires explicitly setting `opts.images_dir_fd` to `-1` for **every
request**, because Protobuf treats the field as required, even though its default value is already `-1`.

This makes the field unnecessarily mandatory.

Signed-off-by: Andrii Herheliuk <andrii@herheliuk.com>
@herheliuk herheliuk changed the title rpc.proto: making images_dir_fd optional rpc.proto: making images_dir_fd optional Oct 23, 2025
@herheliuk
Copy link
Member Author

herheliuk commented Oct 23, 2025

current example of images_dir usage:

from pycriu import criu as pycriu_criu

criu = pycriu_criu()

criu.opts.images_dir_fd = -1
criu.opts.images_dir = dumps_dir
criu.opts.pid = int(input('pid: '))
criu.opts.shell_job = True
criu.dump()

if we don't set criu.opts.images_dir_fd to -1:

google.protobuf.message.EncodeError: Message criu_req is missing required fields: opts.images_dir_fd


message criu_opts {
required int32 images_dir_fd = 1 [default = -1];
optional int32 images_dir_fd = 1 [default = -1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is likely to break existing users:
https://protobuf.dev/programming-guides/proto2/#required-deprecated

Copy link
Member Author

@herheliuk herheliuk Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can hardcode req.opts.images_dir_fd = self.opts.images_dir_fd on every request, (in pycriu)
but it won't be that pretty.

I'm down for any solution, just to fix this inconvenience (and realistically barrier for newbies).

@herheliuk
Copy link
Member Author

tests have failed.

@herheliuk
Copy link
Member Author

herheliuk commented Oct 23, 2025

a different approach: #2798

@herheliuk herheliuk closed this Oct 23, 2025
@herheliuk herheliuk deleted the rpc-fix branch October 24, 2025 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants