From 85fda4dd7f408423d24d43fcfb7baa8d7b7f2dbe Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 24 Jan 2015 14:13:24 +0100 Subject: [PATCH] rename ZFSDirPlugin to ZFSPoolPlugin Turned out it makes no sense to duplicated DirPlugin features. So I also changed the name to make it less confusing. So we can only create zvols inside a zfs pool with this plugin. --- PVE/Storage.pm | 4 ++-- PVE/Storage/Makefile | 2 +- PVE/Storage/ZFSPlugin.pm | 4 ++-- PVE/Storage/{ZFSDirPlugin.pm => ZFSPoolPlugin.pm} | 12 +++++------- 4 files changed, 10 insertions(+), 12 deletions(-) rename PVE/Storage/{ZFSDirPlugin.pm => ZFSPoolPlugin.pm} (97%) diff --git a/PVE/Storage.pm b/PVE/Storage.pm index 380fbdf..b491484 100755 --- a/PVE/Storage.pm +++ b/PVE/Storage.pm @@ -27,7 +27,7 @@ use PVE::Storage::RBDPlugin; use PVE::Storage::SheepdogPlugin; use PVE::Storage::ISCSIDirectPlugin; use PVE::Storage::GlusterfsPlugin; -use PVE::Storage::ZFSDirPlugin; +use PVE::Storage::ZFSPoolPlugin; use PVE::Storage::ZFSPlugin; # load and initialize all plugins @@ -39,7 +39,7 @@ PVE::Storage::RBDPlugin->register(); PVE::Storage::SheepdogPlugin->register(); PVE::Storage::ISCSIDirectPlugin->register(); PVE::Storage::GlusterfsPlugin->register(); -PVE::Storage::ZFSDirPlugin->register(); +PVE::Storage::ZFSPoolPlugin->register(); PVE::Storage::ZFSPlugin->register(); PVE::Storage::Plugin->init(); diff --git a/PVE/Storage/Makefile b/PVE/Storage/Makefile index c993ea4..f28d5d5 100644 --- a/PVE/Storage/Makefile +++ b/PVE/Storage/Makefile @@ -1,4 +1,4 @@ -SOURCES=Plugin.pm DirPlugin.pm LVMPlugin.pm NFSPlugin.pm ISCSIPlugin.pm RBDPlugin.pm SheepdogPlugin.pm ISCSIDirectPlugin.pm GlusterfsPlugin.pm ZFSDirPlugin.pm ZFSPlugin.pm +SOURCES=Plugin.pm DirPlugin.pm LVMPlugin.pm NFSPlugin.pm ISCSIPlugin.pm RBDPlugin.pm SheepdogPlugin.pm ISCSIDirectPlugin.pm GlusterfsPlugin.pm ZFSPoolPlugin.pm ZFSPlugin.pm .PHONY: install install: diff --git a/PVE/Storage/ZFSPlugin.pm b/PVE/Storage/ZFSPlugin.pm index fab68cb..30215d4 100644 --- a/PVE/Storage/ZFSPlugin.pm +++ b/PVE/Storage/ZFSPlugin.pm @@ -5,9 +5,9 @@ use warnings; use IO::File; use POSIX; use PVE::Tools qw(run_command); -use PVE::Storage::ZFSDirPlugin; +use PVE::Storage::ZFSPoolPlugin; -use base qw(PVE::Storage::ZFSDirPlugin); +use base qw(PVE::Storage::ZFSPoolPlugin); use PVE::Storage::LunCmd::Comstar; use PVE::Storage::LunCmd::Istgt; use PVE::Storage::LunCmd::Iet; diff --git a/PVE/Storage/ZFSDirPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm similarity index 97% rename from PVE/Storage/ZFSDirPlugin.pm rename to PVE/Storage/ZFSPoolPlugin.pm index 5ab5e89..40cd753 100644 --- a/PVE/Storage/ZFSDirPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -1,4 +1,4 @@ -package PVE::Storage::ZFSDirPlugin; +package PVE::Storage::ZFSPoolPlugin; use strict; use warnings; @@ -11,15 +11,14 @@ use PVE::Storage::Plugin; use base qw(PVE::Storage::Plugin); sub type { - return 'zfsdir'; + return 'zfspool'; } sub plugindata { return { - content => [ { images => 1, rootdir => 1, vztmpl => 1, iso => 1, backup => 1}, - { images => 1 }], + content => [ {images => 1}, { images => 1 }], }; -} +} sub properties { return { @@ -36,7 +35,6 @@ sub properties { sub options { return { - path => { fixed => 1 }, pool => { fixed => 1 }, blocksize => { optional => 1 }, sparse => { optional => 1 }, @@ -142,7 +140,7 @@ sub path { if($vtype eq "images"){ $path = "/dev/zvol/$scfg->{pool}/$volname"; } else { - die "$vtype is not allowed in ZFSDir!"; + die "$vtype is not allowed in ZFSPool!"; } return ($path, $vmid, $vtype);