[lxc-devel] [lxd/master] Rsync fixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu Jun 7 23:14:49 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180607/4f49a74b/attachment.bin>
-------------- next part --------------
From c6cd573f3ce065f2cd342ac8e5a4e65ee7cf39af Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 7 Jun 2018 19:13:07 -0400
Subject: [PATCH 1/2] lxd-p2c: Send rsync output to stderr
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #4622

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd-p2c/transfer.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd-p2c/transfer.go b/lxd-p2c/transfer.go
index f7265be27..40e0d662e 100644
--- a/lxd-p2c/transfer.go
+++ b/lxd-p2c/transfer.go
@@ -68,7 +68,7 @@ func rsyncSendSetup(path string, rsyncArgs string) (*exec.Cmd, net.Conn, io.Read
 	rsyncCmd := fmt.Sprintf("sh -c \"%s netcat %s\"", execPath, auds)
 
 	args := []string{
-		"-arvP",
+		"-ar",
 		"--devices",
 		"--numeric-ids",
 		"--partial",
@@ -108,6 +108,7 @@ func rsyncSendSetup(path string, rsyncArgs string) (*exec.Cmd, net.Conn, io.Read
 	args = append(args, []string{"-e", rsyncCmd}...)
 
 	cmd := exec.Command("rsync", args...)
+	cmd.Stdout = os.Stderr
 
 	stderr, err := cmd.StderrPipe()
 	if err != nil {

From 3ca7ef6c688e2e9e5d0fa555ef429565b57c0a4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 7 Jun 2018 19:14:10 -0400
Subject: [PATCH 2/2] lxd/migration: Don't pass -vP to a hidden rsync
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/rsync.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/rsync.go b/lxd/rsync.go
index 21934f853..2f7d43f46 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -104,7 +104,7 @@ func rsyncSendSetup(name string, path string, bwlimit string, execPath string) (
 	}
 
 	cmd := exec.Command("rsync",
-		"-arvP",
+		"-ar",
 		"--devices",
 		"--numeric-ids",
 		"--partial",


More information about the lxc-devel mailing list