Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support criu-image-streamer through RPC #2536

Open
wants to merge 1 commit into
base: criu-dev
Choose a base branch
from

Conversation

lianakoleva
Copy link

Programs calling CRIU through RPC may want access to image streaming for faster data transfer.

To use image streaming through RPC,
(1) criu-image-streamer must be started by the calling program.
(2) The RPC call must enable stream in criu_opts.

The image_dir_mode function was modified to be used by RPC as well. This required some changes to accommodate for CR_CPUINFO, which has a subcommand dump or check.

Programs calling CRIU through RPC may want access to image streaming
for faster data transfer.

To use image streaming through RPC,
(1) criu-image-streamer must be started by the calling program.
(2) The RPC call must enable stream in `criu_opts`.

Signed-off-by: Liana Koleva <43767763+lianakoleva@users.noreply.github.com>
Copy link

github-actions bot commented Jan 6, 2025

A friendly reminder that this PR had no activity for 30 days.

case CR_CPUINFO:
if (!strcmp(argv[optind + 1], "dump"))
return O_DUMP;
/* fallthrough */
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to describe these changes in your commit message?

@@ -1261,7 +1257,7 @@ static int handle_cpuinfo(int sk, CriuReq *msg)
if (pid == 0) {
int ret = 1;

opts.mode = CR_CPUINFO;
opts.mode = (msg->type == CRIU_REQ_TYPE__CPUINFO_DUMP) ? CR_CPUINFO_DUMP : CR_CPUINFO_CHECK;
Copy link
Member

Choose a reason for hiding this comment

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

Why do we change opts.mode here?

else if (!strcmp(mode, "cpuinfo") && !strcmp(subcommand, "dump"))
opts.mode = CR_CPUINFO_DUMP;
else if (!strcmp(mode, "cpuinfo") && !strcmp(subcommand, "check"))
opts.mode = CR_CPUINFO_CHECK;
Copy link
Member

Choose a reason for hiding this comment

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

It might be better to separate the changes for cpuinfo and opts.stream in different commits:
/~https://github.com/checkpoint-restore/criu/blob/criu-dev/CONTRIBUTING.md#separate-your-changes

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