mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
criuSwrk: simplify switch
1. Use "switch t" since we only check t. 2. Remove unneeded t assignment. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -971,15 +971,14 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO
|
||||
}
|
||||
|
||||
t := resp.GetType()
|
||||
switch {
|
||||
case t == criurpc.CriuReqType_FEATURE_CHECK:
|
||||
switch t {
|
||||
case criurpc.CriuReqType_FEATURE_CHECK:
|
||||
logrus.Debugf("Feature check says: %s", resp)
|
||||
criuFeatures = resp.GetFeatures()
|
||||
case t == criurpc.CriuReqType_NOTIFY:
|
||||
case criurpc.CriuReqType_NOTIFY:
|
||||
if err := c.criuNotifications(resp, process, cmd, opts, extFds, oob[:oobn]); err != nil {
|
||||
return err
|
||||
}
|
||||
t = criurpc.CriuReqType_NOTIFY
|
||||
req = &criurpc.CriuReq{
|
||||
Type: &t,
|
||||
NotifySuccess: proto.Bool(true),
|
||||
@@ -993,9 +992,9 @@ func (c *Container) criuSwrk(process *Process, req *criurpc.CriuReq, opts *CriuO
|
||||
return err
|
||||
}
|
||||
continue
|
||||
case t == criurpc.CriuReqType_RESTORE:
|
||||
case t == criurpc.CriuReqType_DUMP:
|
||||
case t == criurpc.CriuReqType_PRE_DUMP:
|
||||
case criurpc.CriuReqType_RESTORE:
|
||||
case criurpc.CriuReqType_DUMP:
|
||||
case criurpc.CriuReqType_PRE_DUMP:
|
||||
default:
|
||||
return fmt.Errorf("unable to parse the response %s", resp.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user