-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use CRIU VERSION RPC if available #1535
Conversation
6ec21ef
to
cdc6d98
Compare
@avagin ping |
libcontainer/container_linux.go
Outdated
// If the version of criu has already been determined there is no need | ||
// to ask criu for the version again. Use the value from c.criuVersion. | ||
if c.criuVersion == 0 { | ||
var x, y, z int |
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 may be better to introduce a function for this code?
libcontainer/container_linux.go
Outdated
|
||
out, err := exec.Command(c.criuPath, "-V").Output() |
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.
In a previous patch you shifted this code and now you shifted it back. Try to avoid such things.
The checkCriuVersion function used a string to specify the minimum version required. This is more comfortable for an external interface but for an internal function this added unnecessary complexity. This changes to version string like '1.5.2' to an integer like 10502. This is already the format used internally in the function. Signed-off-by: Adrian Reber <areber@redhat.com>
If the version of criu has already been determined there is no need to ask criu for the version again. Use the value from c.criuVersion. v2: * reduce unnecessary code movement in the patch series * factor out the criu version parsing into a separate function Signed-off-by: Adrian Reber <areber@redhat.com>
To use the CRIU VERSION RPC the criuSwrk function is adapted to work with CriuOpts set to 'nil' as CriuOpts is not required for the VERSION RPC. Also do not print c.criuVersion if it is '0' as the first RPC call will always be the VERSION call and only after that the version will be known. Signed-off-by: Adrian Reber <areber@redhat.com>
Update criurpc.proto for the upcoming VERSION RPC. This includes lazy_pages for the upcoming lazy migration support. Signed-off-by: Adrian Reber <areber@redhat.com>
With this runC also uses RPC to ask CRIU for its version. CRIU supports a VERSION RPC since CRIU 3.0 and using the RPC interface does not require parsing the console output of CRIU (which could change anytime). For older CRIU versions which do not yet have the VERSION RPC runC falls back to its old CRIU output parsing mode. Once CRIU 3.0 is the minimum version required for runC the old code can be removed. v2: * adapt to changes in the previous patches based on the review Signed-off-by: Adrian Reber <areber@redhat.com>
@avagin: Thanks for having a look. You are right, there was unnecessary code movement which I removed and I also moved the version parsing into a separate function. |
Not sure why travis failed. My other PR (#1541) which includes these patches was successful. So I guess the failure is unrelated to this PR? Any other comments? |
I've retriggered the CI, and will merge if it succeeds. |
With this runC also uses RPC to ask CRIU for its version. CRIU supports a VERSION RPC since CRIU 3.0 and using the RPC interface does not require parsing the console output of CRIU (which could change anytime).
For older CRIU versions which do not yet have the VERSION RPC runC falls back to its old CRIU output parsing mode.
Once CRIU 3.0 is the minimum version required for runC the old code can be removed.