[lxc-devel] [lxd/master] lxd/storage/dir: Don't fail when quota are set

stgraber on Github lxc-bot at linuxcontainers.org
Mon Nov 12 16:12:22 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20181112/df2e8d5d/attachment.bin>
-------------- next part --------------
From 40f96410963d137b8a602ccf837100e0b97508ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Mon, 12 Nov 2018 11:11:49 -0500
Subject: [PATCH] lxd/storage/dir: Don't fail when quota are set
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/storage_dir.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lxd/storage_dir.go b/lxd/storage_dir.go
index eb334ca581..4c607c228c 100644
--- a/lxd/storage_dir.go
+++ b/lxd/storage_dir.go
@@ -885,7 +885,7 @@ func (s *storageDir) ContainerRestore(container container, sourceContainer conta
 }
 
 func (s *storageDir) ContainerGetUsage(container container) (int64, error) {
-	return -1, fmt.Errorf("the directory container backend doesn't support quotas")
+	return -1, fmt.Errorf("The directory container backend doesn't support quotas")
 }
 
 func (s *storageDir) ContainerSnapshotCreate(snapshotContainer container, sourceContainer container) error {
@@ -1281,7 +1281,9 @@ func (s *storageDir) MigrationSink(live bool, container container, snapshots []*
 }
 
 func (s *storageDir) StorageEntitySetQuota(volumeType int, size int64, data interface{}) error {
-	return fmt.Errorf("the directory container backend doesn't support quotas")
+	logger.Warnf("Skipping setting disk quota for '%s' as DIR backend doesn't support them", s.volume.Name)
+
+	return nil
 }
 
 func (s *storageDir) StoragePoolResources() (*api.ResourcesStoragePool, error) {


More information about the lxc-devel mailing list