[lxc-devel] [lxd/master] Migration: Adds support for pre-bidirectional negotiation targets

tomponline on Github lxc-bot at linuxcontainers.org
Mon Jan 27 11:29:46 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200127/8f38ca51/attachment.bin>
-------------- next part --------------
From 94c45dcac77f48122b3f15d6fd82369436f3b180 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Mon, 27 Jan 2020 11:28:39 +0000
Subject: [PATCH] lxd/migration/migration/volumes: Adds support for
 pre-bidirectional negotiation targets

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/migration/migration_volumes.go | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lxd/migration/migration_volumes.go b/lxd/migration/migration_volumes.go
index aff1691510..0ed03c3219 100644
--- a/lxd/migration/migration_volumes.go
+++ b/lxd/migration/migration_volumes.go
@@ -128,6 +128,12 @@ func MatchTypes(offer MigrationHeader, fallbackType MigrationFSType, ourTypes []
 				offeredFeatures = offer.GetZfsFeaturesSlice()
 			} else if offerFSType == MigrationFSType_RSYNC {
 				offeredFeatures = offer.GetRsyncFeaturesSlice()
+				if !shared.StringInSlice("bidirectional", offeredFeatures) {
+					// If no bi-directional support, this means we are getting a response from
+					// an old LXD server that doesn't support bidirectional negotiation, so
+					// assume LXD 3.7 level. NOTE: Do NOT extend this list of arguments.
+					offeredFeatures = []string{"xattrs", "delete", "compress"}
+				}
 			}
 
 			// Find common features in both our type and offered type.


More information about the lxc-devel mailing list