Skip to content

Commit e676dac

Browse files
committed
libct/criu: simplify checkCriuFeatures
Since criu 2.12, rpcOpts is not needed when checking criu features. As we requires criu >= 3.0 in Checkpoint, we can remove rpcOpts. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent f6a8c9b commit e676dac

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

libcontainer/criu_linux.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,15 @@ var criuFeatures *criurpc.CriuFeatures
3030

3131
var ErrCriuMissingFeatures = errors.New("criu is missing features")
3232

33-
func (c *Container) checkCriuFeatures(criuOpts *CriuOpts, rpcOpts *criurpc.CriuOpts, criuFeat *criurpc.CriuFeatures) error {
33+
func (c *Container) checkCriuFeatures(criuOpts *CriuOpts, criuFeat *criurpc.CriuFeatures) error {
3434
t := criurpc.CriuReqType_FEATURE_CHECK
3535

3636
// make sure the features we are looking for are really not from
3737
// some previous check
3838
criuFeatures = nil
3939

4040
req := &criurpc.CriuReq{
41-
Type: &t,
42-
// Theoretically this should not be necessary but CRIU
43-
// segfaults if Opts is empty.
44-
// Fixed in CRIU 2.12
45-
Opts: rpcOpts,
41+
Type: &t,
4642
Features: criuFeat,
4743
}
4844

@@ -397,7 +393,7 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
397393
MemTrack: proto.Bool(true),
398394
}
399395

400-
if err := c.checkCriuFeatures(criuOpts, &rpcOpts, &feat); err != nil {
396+
if err := c.checkCriuFeatures(criuOpts, &feat); err != nil {
401397
return err
402398
}
403399

@@ -411,7 +407,7 @@ func (c *Container) Checkpoint(criuOpts *CriuOpts) error {
411407
feat := criurpc.CriuFeatures{
412408
LazyPages: proto.Bool(true),
413409
}
414-
if err := c.checkCriuFeatures(criuOpts, &rpcOpts, &feat); err != nil {
410+
if err := c.checkCriuFeatures(criuOpts, &feat); err != nil {
415411
return err
416412
}
417413

0 commit comments

Comments
 (0)