diff options
| author | Etienne Perot <EtiennePerot@users.noreply.github.com> | 2023-01-19 18:19:47 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-20 02:19:47 +0000 |
| commit | 559a440a347ffd1bf9dc09d734381d7937cd287c (patch) | |
| tree | 59462cf87c613e6f11f9150236fdc3250094aa50 /vm/gvisor | |
| parent | 551737f1076a910f809cc27ac629c587bc84fc2d (diff) | |
vm/gvisor: implement vmimpl.Infoer for runsc instances (#3622)
This adds VM info for runsc (gVisor) instances, showing the flags passed
to runsc.
Diffstat (limited to 'vm/gvisor')
| -rw-r--r-- | vm/gvisor/gvisor.go | 14 |
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", |
