From 01264bbe6c0bea4ee9e4a0045348c7dfe6c22666 Mon Sep 17 00:00:00 2001 From: Thomas Parrott Date: Mon, 16 Oct 2023 08:37:04 +0100 Subject: [PATCH] [lxd-import] client: ws.Mirror*() usage Signed-off-by: Thomas Parrott --- client/incus_instances.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/incus_instances.go b/client/incus_instances.go index 9dd58f2e2fd..b29dd298afb 100644 --- a/client/incus_instances.go +++ b/client/incus_instances.go @@ -1211,8 +1211,8 @@ func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecP // And attach stdin and stdout to it go func() { - ws.MirrorRead(context.Background(), conn, args.Stdin) - <-ws.MirrorWrite(context.Background(), conn, args.Stdout) + ws.MirrorRead(conn, args.Stdin) + <-ws.MirrorWrite(conn, args.Stdout) _ = conn.Close() if args.DataDone != nil { @@ -1237,7 +1237,7 @@ func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecP } conns = append(conns, conn) - dones[0] = ws.MirrorRead(context.Background(), conn, args.Stdin) + dones[0] = ws.MirrorRead(conn, args.Stdin) } // Handle stdout @@ -1248,7 +1248,7 @@ func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecP } conns = append(conns, conn) - dones[1] = ws.MirrorWrite(context.Background(), conn, args.Stdout) + dones[1] = ws.MirrorWrite(conn, args.Stdout) } // Handle stderr @@ -1259,7 +1259,7 @@ func (r *ProtocolIncus) ExecInstance(instanceName string, exec api.InstanceExecP } conns = append(conns, conn) - dones[2] = ws.MirrorWrite(context.Background(), conn, args.Stderr) + dones[2] = ws.MirrorWrite(conn, args.Stderr) } // Wait for everything to be done @@ -2463,7 +2463,7 @@ func (r *ProtocolIncus) ConsoleInstance(instanceName string, console api.Instanc // And attach stdin and stdout to it go func() { - _, writeDone := ws.Mirror(context.Background(), conn, args.Terminal) + _, writeDone := ws.Mirror(conn, args.Terminal) <-writeDone _ = conn.Close() }() @@ -2550,7 +2550,7 @@ func (r *ProtocolIncus) ConsoleInstanceDynamic(instanceName string, console api. } // Attach reader/writer. - _, writeDone := ws.Mirror(context.Background(), conn, rwc) + _, writeDone := ws.Mirror(conn, rwc) <-writeDone _ = conn.Close()