-
Notifications
You must be signed in to change notification settings - Fork 615
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
base: criu-dev
Are you sure you want to change the base?
Support criu-image-streamer through RPC #2536
Conversation
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>
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 */ |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
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 forCR_CPUINFO
, which has a subcommanddump
orcheck
.