aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmm
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-09-19 15:13:36 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-09-20 14:53:52 +0200
commit3af0330c9e76393836459afcdeba133052fde9d5 (patch)
treefc1deb143db6c4bd8377d0cfae9c50117102da42 /vm/vmm
parent1c10e8337a8f7497758058da87032bb844e87dea (diff)
vm/vmm: make more robust after restarts
Instances from the previous run can still be running, so always stop the previous instances before starting new ones.
Diffstat (limited to 'vm/vmm')
-rw-r--r--vm/vmm/vmm.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go
index dcf417f17..97c83ffcf 100644
--- a/vm/vmm/vmm.go
+++ b/vm/vmm/vmm.go
@@ -115,6 +115,7 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) {
stop: make(chan bool),
diagnose: make(chan string),
}
+ inst.vmctl("stop", inst.vmName, "-f", "-w") // in case it's still running from the previous run
closeInst := inst
defer func() {
if closeInst != nil {