aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmware
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/vmware
parenta893841a9f868b1590b9dacfa772d634629ad88d (diff)
vm: make Instance implement io.Closer
It's better to follow standard interfaces.
Diffstat (limited to 'vm/vmware')
-rw-r--r--vm/vmware/vmware.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/vm/vmware/vmware.go b/vm/vmware/vmware.go
index f2b3431c0..210a4957a 100644
--- a/vm/vmware/vmware.go
+++ b/vm/vmware/vmware.go
@@ -144,7 +144,7 @@ func (inst *instance) Forward(port int) (string, error) {
return fmt.Sprintf("127.0.0.1:%v", port), nil
}
-func (inst *instance) Close() {
+func (inst *instance) Close() error {
if inst.debug {
log.Logf(0, "stopping %v", inst.vmx)
}
@@ -154,6 +154,7 @@ func (inst *instance) Close() {
}
osutil.RunCmd(2*time.Minute, "", "vmrun", "deleteVM", inst.vmx)
close(inst.closed)
+ return nil
}
func (inst *instance) Copy(hostSrc string) (string, error) {