[lxc-devel] [lxd/master] Storage: Fixes 10s delay when using VMs with ZFS in snap

tomponline on Github lxc-bot at linuxcontainers.org
Mon Dec 7 11:22:59 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 446 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201207/364dcf06/attachment.bin>
-------------- next part --------------
From 2c6b7c840cfd03c1328a4ec3953239116b87321a Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Mon, 7 Dec 2020 11:21:40 +0000
Subject: [PATCH] lxd/storage/drivers/drivers/zfs/volumes: Fixes 10s delay when
 using VMs with ZFS in snap

This is caused because /dev/zvol appears to not be populated when using the snap.

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/storage/drivers/driver_zfs_volumes.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/storage/drivers/driver_zfs_volumes.go b/lxd/storage/drivers/driver_zfs_volumes.go
index 42e8056d1b..78152519e9 100644
--- a/lxd/storage/drivers/driver_zfs_volumes.go
+++ b/lxd/storage/drivers/driver_zfs_volumes.go
@@ -1003,7 +1003,7 @@ func (d *zfs) SetVolumeQuota(vol Volume, size string, op *operations.Operation)
 // GetVolumeDiskPath returns the location of a root disk block device.
 func (d *zfs) GetVolumeDiskPath(vol Volume) (string, error) {
 	// Shortcut for udev.
-	if tryExists(filepath.Join("/dev/zvol", d.dataset(vol, false))) {
+	if shared.PathExists(filepath.Join("/dev/zvol", d.dataset(vol, false))) {
 		return filepath.Join("/dev/zvol", d.dataset(vol, false)), nil
 	}
 


More information about the lxc-devel mailing list