[prev in list] [next in list] [prev in thread] [next in thread]
List: lxc-devel
Subject: [lxc-devel] [lxd/master] patches: do not parse volume.size for lvm
From: brauner on Github <lxc-bot () linuxcontainers ! org>
Date: 2017-02-26 0:55:59
Message-ID: 20170226005559.C681D402EF () mailman01 ! srv ! dcmtl ! stgraber ! net
[Download RAW message or body]
[Attachment #2 (text/x-mailbox)]
The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2957
This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.
=== Description (from pull-request) ===
It really doesn't make a lot of sense to look at the size of the volume group.
Simply set the default.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
[Attachment #3 (text/plain)]
From 7ca72c812b69efb6104fd0fe703bfe4c2a59ee5a Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner@ubuntu.com>
Date: Sun, 26 Feb 2017 01:53:55 +0100
Subject: [PATCH] patches: do not parse volume.size for lvm
It really doesn't make a lot of sense to look at the size of the volume group.
Simply set the default.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
---
lxd/patches.go | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/lxd/patches.go b/lxd/patches.go
index dbe91fe..605b860 100644
--- a/lxd/patches.go
+++ b/lxd/patches.go
@@ -5,7 +5,6 @@ import (
"os"
"os/exec"
"path/filepath"
- "strconv"
"strings"
"syscall"
@@ -796,21 +795,7 @@ func upgradeFromStorageTypeLvm(name string, d *Daemon, \
defaultPoolName string, d poolConfig["lvm.vg_name"] = \
daemonConfig["storage.lvm_vg_name"].Get()
poolConfig["volume.size"] = daemonConfig["storage.lvm_volume_size"].Get()
- if poolConfig["volume.size"] == "" {
- // Get size of the volume group.
- output, err := tryExec("vgs", "--nosuffix", "--units", "b", "--noheadings", "-o", \
"size", defaultPoolName)
- if err != nil {
- return err
- }
- tmp := string(output)
- tmp = strings.TrimSpace(tmp)
- szFloat, err := strconv.ParseFloat(tmp, 32)
- if err != nil {
- return err
- }
- szInt64 := shared.Round(szFloat)
- poolConfig["volume.size"] = fmt.Sprintf("%dGB", szInt64)
- } else {
+ if poolConfig["volume.size"] != "" {
// In case stuff like GiB is used which
// share.dParseByteSizeString() doesn't handle.
if strings.Contains(poolConfig["volume.size"], "i") {
[Attachment #4 (text/plain)]
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic