[lxc-devel] [lxd/master] lxc copy: simplify

brauner on Github lxc-bot at linuxcontainers.org
Sat Apr 29 22:17:01 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170429/071db1c4/attachment.bin>
-------------- next part --------------
From 76acb9021a7cc8ba491bb4bf28431ed798cd994b Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Sun, 30 Apr 2017 00:16:16 +0200
Subject: [PATCH] lxc copy: simplify

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 lxc/copy.go | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/lxc/copy.go b/lxc/copy.go
index 95127c6..f380306 100644
--- a/lxc/copy.go
+++ b/lxc/copy.go
@@ -211,16 +211,7 @@ func (c *copyCmd) copyContainer(config *lxd.Config, sourceResource string, destR
 	 */
 	waitchan := make(chan map[int]error, 2)
 	wait := func(cli *lxd.Client, op string, ch chan map[int]error, senderid int) {
-		msg := make(map[int]error, 1)
-		err := cli.WaitForSuccess(op)
-		if err != nil {
-			msg[senderid] = err
-			ch <- msg
-			return
-		}
-
-		msg[senderid] = nil
-		ch <- msg
+		ch <- map[int]error{senderid: cli.WaitForSuccess(op)}
 	}
 
 	var migrationErrFromClient error


More information about the lxc-devel mailing list