ReadControlFiles is an RPC stub for batch-reading cgroupfs control files.
(args *CgroupsReadArgs, out *CgroupsResults)
| 107 | |
| 108 | // ReadControlFiles is an RPC stub for batch-reading cgroupfs control files. |
| 109 | func (c *Cgroups) ReadControlFiles(args *CgroupsReadArgs, out *CgroupsResults) error { |
| 110 | ctx := c.Kernel.SupervisorContext() |
| 111 | for _, arg := range args.Args { |
| 112 | cg, err := c.findCgroup(ctx, arg.File) |
| 113 | if err != nil { |
| 114 | out.appendError(err) |
| 115 | continue |
| 116 | } |
| 117 | |
| 118 | val, err := cg.ReadControl(ctx, arg.File.Name) |
| 119 | if err != nil { |
| 120 | out.appendError(err) |
| 121 | } else { |
| 122 | out.appendValue(val) |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | return nil |
| 127 | } |
| 128 | |
| 129 | // CgroupsWriteArg represents the arguments for a single write command. |
| 130 | type CgroupsWriteArg struct { |
no test coverage detected