diff options
| -rw-r--r-- | vm/kvm/kvm.go | 6 | ||||
| -rw-r--r-- | vm/qemu/qemu.go | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/vm/kvm/kvm.go b/vm/kvm/kvm.go index 40add4604..2f1fb890b 100644 --- a/vm/kvm/kvm.go +++ b/vm/kvm/kvm.go @@ -217,8 +217,10 @@ func (inst *instance) Run(timeout time.Duration, command string) (<-chan []byte, signal := func(err error) { time.Sleep(3 * time.Second) // wait for any pending output inst.mu.Lock() - inst.outputB = nil - inst.outputC = nil + if inst.outputC == outputC { + inst.outputB = nil + inst.outputC = nil + } inst.mu.Unlock() errorC <- err } diff --git a/vm/qemu/qemu.go b/vm/qemu/qemu.go index 32af2d732..5571f2382 100644 --- a/vm/qemu/qemu.go +++ b/vm/qemu/qemu.go @@ -277,8 +277,10 @@ func (inst *instance) Run(timeout time.Duration, command string) (<-chan []byte, signal := func(err error) { time.Sleep(3 * time.Second) // wait for any pending output inst.mu.Lock() - inst.outputB = nil - inst.outputC = nil + if inst.outputC == outputC { + inst.outputB = nil + inst.outputC = nil + } inst.mu.Unlock() select { case errorC <- err: |
