aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-12-02 13:23:51 +0000
committerDmitry Vyukov <dvyukov@google.com>2018-12-02 13:23:51 +0000
commit7dcaeaf3220109910515ec208b7ed6db4e8435a2 (patch)
tree278868b97beb188d346f84f802d314cfb13391df
parent7a0edfbe7c3703a0bf48f01dd818173a68a8f747 (diff)
vm/gce: close old consolew in Run
Run can be executed several times on a VM.
-rw-r--r--vm/gce/gce.go3
-rw-r--r--vm/vmimpl/openbsd.go3
2 files changed, 6 insertions, 0 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index 4c3708ad5..d2ce480ff 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -228,6 +228,9 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
conWpipe.Close()
return nil, nil, err
}
+ if inst.consolew != nil {
+ inst.consolew.Close()
+ }
inst.consolew = conw
if err := con.Start(); err != nil {
conRpipe.Close()
diff --git a/vm/vmimpl/openbsd.go b/vm/vmimpl/openbsd.go
index 79132ebf8..221e1e4db 100644
--- a/vm/vmimpl/openbsd.go
+++ b/vm/vmimpl/openbsd.go
@@ -1,3 +1,6 @@
+// Copyright 2018 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
package vmimpl
import (