[pve-devel] [PATCH 5/9] zfs: ZFSDirPlugin add methode path

Wolfgang Link w.link at proxmox.com
Fri Jan 23 10:32:41 CET 2015


Signed-off-by: Wolfgang Link <w.link at proxmox.com>
---
 PVE/Storage/ZFSDirPlugin.pm |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/PVE/Storage/ZFSDirPlugin.pm b/PVE/Storage/ZFSDirPlugin.pm
index fb7a1a2..260e328 100644
--- a/PVE/Storage/ZFSDirPlugin.pm
+++ b/PVE/Storage/ZFSDirPlugin.pm
@@ -132,6 +132,22 @@ sub parse_volname {
 
 # virtual zfs methods (subclass can overwrite them)
 
+sub path {
+    my ($class, $scfg, $volname) = @_;
+
+    my ($vtype, $name, $vmid) = $class->parse_volname($volname);
+
+    my $path = '';
+
+    if($vtype eq "images"){
+	$path = "/dev/zvol/$scfg->{pool}/$volname";
+    } else {
+	die "$vtype is not allowed in ZFSDir!";
+    }
+
+    return ($path, $vmid, $vtype);
+}
+
 sub zfs_request {
     my ($class, $scfg, $timeout, $method, @params) = @_;
 
-- 
1.7.10.4





More information about the pve-devel mailing list