diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-05-15 15:01:02 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-05-19 09:39:47 +0000 |
| commit | 27f689959decd391b047c8034d481267d500549e (patch) | |
| tree | 79ce6364d592fd6841e25ec64ca645fc3c65cdcf /vm/adb/adb.go | |
| parent | 8f9cf946b3733d0b4ad3124bce155a4fc3849c3a (diff) | |
vm: func Run accepts context
It allows to use context as a single termination signal source.
Diffstat (limited to 'vm/adb/adb.go')
| -rw-r--r-- | vm/adb/adb.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 1a7ed7e17..202f352c0 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -7,6 +7,7 @@ package adb import ( "bytes" + "context" "encoding/json" "fmt" "io" @@ -521,7 +522,7 @@ func isRemoteCuttlefish(dev string) (bool, string) { return true, ip } -func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command string) ( +func (inst *instance) Run(ctx context.Context, command string) ( <-chan []byte, <-chan error, error) { var tty io.ReadCloser var err error @@ -566,9 +567,8 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin merger.Add("console", tty) merger.Add("adb", adbRpipe) - return vmimpl.Multiplex(adb, merger, timeout, vmimpl.MultiplexConfig{ + return vmimpl.Multiplex(ctx, adb, merger, vmimpl.MultiplexConfig{ Console: tty, - Stop: stop, Close: inst.closed, Debug: inst.debug, Scale: inst.timeouts.Scale, |
