[lxc-devel] [lxd/master] lxd/storage/zfs: Fix snapshot restore on project

stgraber on Github lxc-bot at linuxcontainers.org
Fri May 17 09:56:14 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 370 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190517/09ab8b69/attachment-0001.bin>
-------------- next part --------------
From 8b93014bc74f90b5088589a45a391baa2f8f7b5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Fri, 17 May 2019 11:55:38 +0200
Subject: [PATCH] lxd/storage/zfs: Fix snapshot restore on project
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #5773

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

diff --git a/lxd/storage_zfs.go b/lxd/storage_zfs.go
index 5667c557ae..dc849f0f80 100644
--- a/lxd/storage_zfs.go
+++ b/lxd/storage_zfs.go
@@ -1557,7 +1557,7 @@ func (s *storageZfs) ContainerRestore(target container, source container) error
 	cName, snapOnlyName, _ := containerGetParentAndSnapshotName(source.Name())
 	snapName := fmt.Sprintf("snapshot-%s", snapOnlyName)
 
-	err = zfsPoolVolumeSnapshotRestore(s.getOnDiskPoolName(), fmt.Sprintf("containers/%s", cName), snapName)
+	err = zfsPoolVolumeSnapshotRestore(s.getOnDiskPoolName(), fmt.Sprintf("containers/%s", projectPrefix(source.Project(), cName)), snapName)
 	if err != nil {
 		return err
 	}


More information about the lxc-devel mailing list