MCPcopy
hub / github.com/opencontainers/runc / addMaskPaths

Method addMaskPaths

libcontainer/criu_linux.go:127–147  ·  view source on GitHub ↗
(req *criurpc.CriuReq)

Source from the content-addressed store, hash-verified

125}
126
127func (c *Container) addMaskPaths(req *criurpc.CriuReq) error {
128 for _, path := range c.config.MaskPaths {
129 fi, err := os.Stat(fmt.Sprintf("/proc/%d/root/%s", c.initProcess.pid(), path))
130 if err != nil {
131 if errors.Is(err, os.ErrNotExist) {
132 continue
133 }
134 return err
135 }
136 if fi.IsDir() {
137 continue
138 }
139
140 extMnt := &criurpc.ExtMountMap{
141 Key: mkPtr(path),
142 Val: mkPtr("/dev/null"),
143 }
144 req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
145 }
146 return nil
147}
148
149func (c *Container) handleCriuConfigurationFile(rpcOpts *criurpc.CriuOpts) {
150 // CRIU will evaluate a configuration starting with release 3.11.

Callers 1

CheckpointMethod · 0.95

Calls 2

mkPtrFunction · 0.70
pidMethod · 0.65

Tested by

no test coverage detected