[pve-devel] [PATCHV_2 pve-storage] Change zfspoolplugin path when snapshot is given.

Wolfgang Link w.link at proxmox.com
Thu Nov 19 12:28:20 CET 2015


Zfs subvol snapshots are always mounted under $path_of_subvol/.zfs/$snapname
---
 PVE/Storage/ZFSPoolPlugin.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 0c1d8d9..dc9ece7 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -149,12 +149,12 @@ sub path {
 
     if ($vtype eq "images") {
 	if ($volname =~ m/^subvol-/) {
-	    # fixme: we currently assume standard mount point?!
 	    $path = "/$scfg->{pool}/$volname";
+	    $path .= "/.zfs/snapshot/$snapname" if defined($snapname);
 	} else {
 	    $path = "/dev/zvol/$scfg->{pool}/$volname";
+	    $path .= "\@$snapname" if defined($snapname);
 	}
-	$path .= "\@$snapname" if defined($snapname);
     } else {
 	die "$vtype is not allowed in ZFSPool!";
     }
-- 
2.1.4





More information about the pve-devel mailing list