forked from opencontainers/runc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pause.go
47 lines (41 loc) · 999 Bytes
/
pause.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// +build linux
package main
import "github.com/urfave/cli"
var pauseCommand = cli.Command{
Name: "pause",
Usage: "pause suspends the virtual machine",
ArgsUsage: "",
Description: "The pause command suspends a running virtual machine.",
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
return err
}
container, err := getContainer(context)
if err != nil {
return err
}
if err := container.Pause(); err != nil {
return err
}
return nil
},
}
var resumeCommand = cli.Command{
Name: "resume",
Usage: "resumes the suspended virtual machine",
ArgsUsage: "",
Description: "The resume command resumes the suspended virtual machine",
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
return err
}
container, err := getContainer(context)
if err != nil {
return err
}
if err := container.Resume(); err != nil {
return err
}
return nil
},
}