The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/3544

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) ===
Closes #3543.

Signed-off-by: Christian Brauner <[email protected]>
From 505f183e842606e843d8896b100ed32eedebd0e6 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Thu, 13 Jul 2017 11:50:08 +0200
Subject: [PATCH 1/2] lvm: non-functional changes

Signed-off-by: Christian Brauner <[email protected]>
---
 lxd/storage_lvm.go       |  5 +++++
 lxd/storage_lvm_utils.go | 20 +++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/lxd/storage_lvm.go b/lxd/storage_lvm.go
index 381221ea8..6eaeafc77 100644
--- a/lxd/storage_lvm.go
+++ b/lxd/storage_lvm.go
@@ -858,8 +858,13 @@ func (s *storageLvm) ContainerCreateFromImage(container 
container, fingerprint s
                err = s.containerCreateFromImageLv(container, fingerprint)
        }
        if err != nil {
+               logger.Errorf(`Failed to create LVM storage volume for `+
+               `container "%s" on storage pool "%s": %s`, containerName,
+                       s.pool.Name, err)
                return err
        }
+       logger.Debugf(`Created LVM storage volume for container "%s" on `+
+               `storage pool "%s"`, containerName, s.pool.Name)
        defer func() {
                if tryUndo {
                        s.ContainerDelete(container)
diff --git a/lxd/storage_lvm_utils.go b/lxd/storage_lvm_utils.go
index 6def237ac..c0bb24f18 100644
--- a/lxd/storage_lvm_utils.go
+++ b/lxd/storage_lvm_utils.go
@@ -415,25 +415,43 @@ func (s *storageLvm) copyContainer(target container, 
source container) error {
 }
 
 func (s *storageLvm) containerCreateFromImageLv(c container, fp string) error {
+       containerName := c.Name()
+
        err := s.ContainerCreate(c)
        if err != nil {
+               logger.Errorf(`Failed to create non-thinpool LVM storage `+
+                       `volume for container "%s" on storage pool "%s": %s`,
+                       containerName, s.pool.Name, err)
                return err
        }
+       logger.Debugf(`Created non-thinpool LVM storage volume for container `+
+               `"%s" on storage pool "%s"`, containerName, s.pool.Name)
 
-       containerName := c.Name()
        containerPath := c.Path()
        _, err = s.ContainerMount(c)
        if err != nil {
+               logger.Errorf(`Failed to mount non-thinpool LVM storage `+
+                       `volume for container "%s" on storage pool "%s": %s`,
+                       containerName, s.pool.Name, err)
                return err
        }
+       logger.Debugf(`Mounted non-thinpool LVM storage volume for container `+
+               `"%s" on storage pool "%s"`, containerName, s.pool.Name)
 
        imagePath := shared.VarPath("images", fp)
        poolName := s.getOnDiskPoolName()
        containerMntPoint := getContainerMountPoint(poolName, containerName)
        err = unpackImage(s.d, imagePath, containerMntPoint, storageTypeLvm)
        if err != nil {
+               logger.Errorf(`Failed to unpack image "%s" into non-thinpool `+
+                       `LVM storage volume "%s" for container "%s" on `+
+                       `storage pool "%s": %s`, imagePath, containerMntPoint,
+                       containerName, s.pool.Name, err)
                return err
        }
+       logger.Debugf(`Unpacked image "%s" into non-thinpool LVM storage `+
+               `volume "%s" for container "%s" on storage pool "%s"`,
+               imagePath, containerMntPoint, containerName, s.pool.Name)
 
        s.ContainerUmount(containerName, containerPath)
 

From 12a7fd1472f9db7d55985f42e3a0297d1a093a66 Mon Sep 17 00:00:00 2001
From: Christian Brauner <[email protected]>
Date: Thu, 13 Jul 2017 11:50:50 +0200
Subject: [PATCH 2/2] lvm: fix non-thinpool container creation

Closes #3543.

Signed-off-by: Christian Brauner <[email protected]>
---
 lxd/storage_lvm_utils.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lxd/storage_lvm_utils.go b/lxd/storage_lvm_utils.go
index c0bb24f18..148635542 100644
--- a/lxd/storage_lvm_utils.go
+++ b/lxd/storage_lvm_utils.go
@@ -439,8 +439,7 @@ func (s *storageLvm) containerCreateFromImageLv(c 
container, fp string) error {
                `"%s" on storage pool "%s"`, containerName, s.pool.Name)
 
        imagePath := shared.VarPath("images", fp)
-       poolName := s.getOnDiskPoolName()
-       containerMntPoint := getContainerMountPoint(poolName, containerName)
+       containerMntPoint := getContainerMountPoint(s.pool.Name, containerName)
        err = unpackImage(s.d, imagePath, containerMntPoint, storageTypeLvm)
        if err != nil {
                logger.Errorf(`Failed to unpack image "%s" into non-thinpool `+
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to