aboutsummaryrefslogtreecommitdiffstats
path: root/vm/gvisor/gvisor.go
diff options
context:
space:
mode:
Diffstat (limited to 'vm/gvisor/gvisor.go')
-rw-r--r--vm/gvisor/gvisor.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go
index 31e3a10d5..cf9a8b126 100644
--- a/vm/gvisor/gvisor.go
+++ b/vm/gvisor/gvisor.go
@@ -210,7 +210,7 @@ func (inst *instance) waitBoot() error {
}
}
-func (inst *instance) runscCmd(add ...string) *exec.Cmd {
+func (inst *instance) args() []string {
args := []string{
"-root", inst.rootDir,
"-watchdog-action=panic",
@@ -223,8 +223,16 @@ func (inst *instance) runscCmd(add ...string) *exec.Cmd {
if inst.cfg.RunscArgs != "" {
args = append(args, strings.Split(inst.cfg.RunscArgs, " ")...)
}
- args = append(args, add...)
- cmd := osutil.Command(inst.image, args...)
+ return args
+}
+
+func (inst *instance) Info() ([]byte, error) {
+ info := fmt.Sprintf("%v %v\n", inst.image, strings.Join(inst.args(), " "))
+ return []byte(info), nil
+}
+
+func (inst *instance) runscCmd(add ...string) *exec.Cmd {
+ cmd := osutil.Command(inst.image, append(inst.args(), add...)...)
cmd.Env = []string{
"GOTRACEBACK=all",
"GORACE=halt_on_error=1",