Skip to content

Commit 655f1ce

Browse files
avagincrosbymichael
authored andcommitted
Rename StdFds into ExternalDescriptors
Signed-off-by: Andrey Vagin <[email protected]>
1 parent 6ecf32c commit 655f1ce

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

container.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type State struct {
5151
Config configs.Config `json:"config"`
5252

5353
// Container's standard descriptors (std{in,out,err}), needed for checkpoint and restore
54-
StdFds [3]string `json:"std_fds,omitempty"`
54+
ExternalDescriptors [3]string `json:"external_descriptors,omitempty"`
5555
}
5656

5757
// A libcontainer container object.

container_linux.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
371371

372372
// Write the FD info to a file in the image directory
373373

374-
fdsJSON, err := json.Marshal(c.initProcess.stdFds())
374+
fdsJSON, err := json.Marshal(c.initProcess.externalDescriptors())
375375
if err != nil {
376376
return err
377377
}
@@ -563,7 +563,7 @@ func (c *linuxContainer) criuSwrk(process *Process, req *criurpc.CriuReq, opts *
563563
if err != nil {
564564
return err
565565
}
566-
c.initProcess.setStdFds(fds)
566+
c.initProcess.setExternalDescriptors(fds)
567567
}
568568

569569
data, err := proto.Marshal(req)
@@ -700,7 +700,7 @@ func (c *linuxContainer) criuNotifications(resp *criurpc.CriuResp, process *Proc
700700

701701
case notify.GetScript() == "post-restore":
702702
pid := notify.GetPid()
703-
r, err := newRestoredProcess(int(pid), c.initProcess.stdFds())
703+
r, err := newRestoredProcess(int(pid), c.initProcess.externalDescriptors())
704704
if err != nil {
705705
return err
706706
}
@@ -771,7 +771,7 @@ func (c *linuxContainer) currentState() (*State, error) {
771771
InitProcessStartTime: startTime,
772772
CgroupPaths: c.cgroupManager.GetPaths(),
773773
NamespacePaths: make(map[configs.NamespaceType]string),
774-
StdFds: c.initProcess.stdFds(),
774+
ExternalDescriptors: c.initProcess.externalDescriptors(),
775775
}
776776
for _, ns := range c.config.Namespaces {
777777
state.NamespacePaths[ns.Type] = ns.GetPath(c.initProcess.pid())

factory_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (l *LinuxFactory) Load(id string) (Container, error) {
182182
r := &nonChildProcess{
183183
processPid: state.InitProcessPid,
184184
processStartTime: state.InitProcessStartTime,
185-
fds: state.StdFds,
185+
fds: state.ExternalDescriptors,
186186
}
187187
return &linuxContainer{
188188
initProcess: r,

process_linux.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ type parentProcess interface {
3434

3535
signal(os.Signal) error
3636

37-
stdFds() [3]string
37+
externalDescriptors() [3]string
3838

39-
setStdFds(fds [3]string)
39+
setExternalDescriptors(fds [3]string)
4040
}
4141

4242
type setnsProcess struct {
@@ -149,11 +149,11 @@ func (p *setnsProcess) pid() int {
149149
return p.cmd.Process.Pid
150150
}
151151

152-
func (p *setnsProcess) stdFds() [3]string {
152+
func (p *setnsProcess) externalDescriptors() [3]string {
153153
return p.fds
154154
}
155155

156-
func (p *setnsProcess) setStdFds(newFds [3]string) {
156+
func (p *setnsProcess) setExternalDescriptors(newFds [3]string) {
157157
p.fds = newFds
158158
}
159159

@@ -171,7 +171,7 @@ func (p *initProcess) pid() int {
171171
return p.cmd.Process.Pid
172172
}
173173

174-
func (p *initProcess) stdFds() [3]string {
174+
func (p *initProcess) externalDescriptors() [3]string {
175175
return p.fds
176176
}
177177

@@ -189,7 +189,7 @@ func (p *initProcess) start() error {
189189
if err != nil {
190190
return newSystemError(err)
191191
}
192-
p.setStdFds(fds);
192+
p.setExternalDescriptors(fds);
193193

194194
// Do this before syncing with child so that no children
195195
// can escape the cgroup
@@ -281,7 +281,7 @@ func (p *initProcess) signal(sig os.Signal) error {
281281
return syscall.Kill(p.cmd.Process.Pid, s)
282282
}
283283

284-
func (p *initProcess) setStdFds(newFds [3]string) {
284+
func (p *initProcess) setExternalDescriptors(newFds [3]string) {
285285
p.fds = newFds
286286
}
287287

restored_process.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ func (p *restoredProcess) signal(s os.Signal) error {
6868
return p.proc.Signal(s)
6969
}
7070

71-
func (p *restoredProcess) stdFds() [3]string {
71+
func (p *restoredProcess) externalDescriptors() [3]string {
7272
return p.fds
7373
}
7474

75-
func (p *restoredProcess) setStdFds(newFds [3]string) {
75+
func (p *restoredProcess) setExternalDescriptors(newFds [3]string) {
7676
p.fds = newFds
7777
}
7878

@@ -109,10 +109,10 @@ func (p *nonChildProcess) signal(s os.Signal) error {
109109
return newGenericError(fmt.Errorf("restored process cannot be signaled"), SystemError)
110110
}
111111

112-
func (p *nonChildProcess) stdFds() [3]string {
112+
func (p *nonChildProcess) externalDescriptors() [3]string {
113113
return p.fds
114114
}
115115

116-
func (p *nonChildProcess) setStdFds(newFds [3]string) {
116+
func (p *nonChildProcess) setExternalDescriptors(newFds [3]string) {
117117
p.fds = newFds
118118
}

0 commit comments

Comments
 (0)