aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmm
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-07-08 12:45:31 +0200
committerAleksandr Nogikh <nogikh@google.com>2024-07-11 09:03:37 +0000
commitbdca406b2cf89f029207aa8213460ec7a3267ccc (patch)
tree077a43542b50ba8c6db9cc91567fb332032a3913 /vm/vmm
parenta893841a9f868b1590b9dacfa772d634629ad88d (diff)
vm: make Instance implement io.Closer
It's better to follow standard interfaces.
Diffstat (limited to 'vm/vmm')
-rw-r--r--vm/vmm/vmm.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go
index 71dfd39b4..6a6242882 100644
--- a/vm/vmm/vmm.go
+++ b/vm/vmm/vmm.go
@@ -216,7 +216,7 @@ func (inst *instance) lookupSSHAddress() (string, error) {
return fmt.Sprintf("100.64.%s.3", matches[1]), nil
}
-func (inst *instance) Close() {
+func (inst *instance) Close() error {
inst.vmctl("stop", "-f", inst.vmName)
if inst.consolew != nil {
inst.consolew.Close()
@@ -226,6 +226,7 @@ func (inst *instance) Close() {
inst.vmm.Wait()
}
inst.merger.Wait()
+ return nil
}
func (inst *instance) Forward(port int) (string, error) {