mirror of
https://github.com/opencontainers/runc.git
synced 2026-04-23 07:21:09 +08:00
libct: criuSwrk: only iterate over CriuOpts if debug is set
In case log level is less than debug, this code does nothing, so let's add a condition and skip it entirely. Add a test case to make sure this code path is hit. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -1524,8 +1524,9 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *
|
||||
// should be empty. For older CRIU versions it still will be
|
||||
// available but empty. criurpc.CriuReqType_VERSION actually
|
||||
// has no req.GetOpts().
|
||||
if !(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK ||
|
||||
req.GetType() == criurpc.CriuReqType_VERSION) {
|
||||
if logrus.GetLevel() >= logrus.DebugLevel &&
|
||||
!(req.GetType() == criurpc.CriuReqType_FEATURE_CHECK ||
|
||||
req.GetType() == criurpc.CriuReqType_VERSION) {
|
||||
|
||||
val := reflect.ValueOf(req.GetOpts())
|
||||
v := reflect.Indirect(val)
|
||||
|
||||
Reference in New Issue
Block a user