From 27f689959decd391b047c8034d481267d500549e Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 15 May 2025 15:01:02 +0200 Subject: vm: func Run accepts context It allows to use context as a single termination signal source. --- vm/cuttlefish/cuttlefish.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'vm/cuttlefish/cuttlefish.go') diff --git a/vm/cuttlefish/cuttlefish.go b/vm/cuttlefish/cuttlefish.go index dcc825fbf..55e56d2e5 100644 --- a/vm/cuttlefish/cuttlefish.go +++ b/vm/cuttlefish/cuttlefish.go @@ -11,6 +11,7 @@ package cuttlefish import ( + "context" "fmt" "os/exec" "path/filepath" @@ -167,9 +168,9 @@ func (inst *instance) Close() error { return inst.gceInst.Close() } -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) { - return inst.gceInst.Run(timeout, stop, fmt.Sprintf("adb shell 'cd %s; %s'", deviceRoot, command)) + return inst.gceInst.Run(ctx, fmt.Sprintf("adb shell 'cd %s; %s'", deviceRoot, command)) } func (inst *instance) Diagnose(rep *report.Report) ([]byte, bool) { -- cgit mrf-deployment