[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Tue Jun 21 16:42:54 UTC 2016


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/20160621/5314623e/attachment.bin>
-------------- next part --------------
From b8c18b754b37b2e02e2f05ac5dddc15c5105978e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 21 Jun 2016 11:36:44 -0400
Subject: [PATCH 1/2] Allow "none" as compression algorithm
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/daemon_config.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lxd/daemon_config.go b/lxd/daemon_config.go
index ba55556..b941999 100644
--- a/lxd/daemon_config.go
+++ b/lxd/daemon_config.go
@@ -175,7 +175,7 @@ func daemonConfigInit(db *sql.DB) error {
 
 		"images.auto_update_cached":    &daemonConfigKey{valueType: "bool", defaultValue: "true"},
 		"images.auto_update_interval":  &daemonConfigKey{valueType: "int", defaultValue: "6"},
-		"images.compression_algorithm": &daemonConfigKey{valueType: "string", validator: daemonConfigValidateCommand, defaultValue: "gzip"},
+		"images.compression_algorithm": &daemonConfigKey{valueType: "string", validator: daemonConfigValidateCompression, defaultValue: "gzip"},
 		"images.remote_cache_expiry":   &daemonConfigKey{valueType: "int", defaultValue: "10", trigger: daemonConfigTriggerExpiry},
 
 		"storage.lvm_fstype":           &daemonConfigKey{valueType: "string", defaultValue: "ext4", validValues: []string{"ext4", "xfs"}},
@@ -312,7 +312,11 @@ func daemonConfigTriggerExpiry(d *Daemon, key string, value string) {
 	d.pruneChan <- true
 }
 
-func daemonConfigValidateCommand(d *Daemon, key string, value string) error {
+func daemonConfigValidateCompression(d *Daemon, key string, value string) error {
+	if value == "none" {
+		return nil
+	}
+
 	_, err := exec.LookPath(value)
 	return err
 }

From a830539478d35777f411551d485ddf6ffb0beff3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Tue, 21 Jun 2016 12:41:38 -0400
Subject: [PATCH 2/2] init: actually unset the storage keys
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/main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/main.go b/lxd/main.go
index 3968e18..99d10b4 100644
--- a/lxd/main.go
+++ b/lxd/main.go
@@ -833,7 +833,7 @@ they otherwise would.
 	}
 
 	// Unset all storage keys, core.https_address and core.trust_password
-	for _, key := range []string{"core.https_address", "core.trust_password"} {
+	for _, key := range []string{"storage.zfs_pool_name", "core.https_address", "core.trust_password"} {
 		_, err = c.SetServerConfig(key, "")
 		if err != nil {
 			return err


More information about the lxc-devel mailing list