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.
This commit is contained in:
@ -27,7 +27,7 @@ use PVE::Storage::RBDPlugin;
|
|||||||
use PVE::Storage::SheepdogPlugin;
|
use PVE::Storage::SheepdogPlugin;
|
||||||
use PVE::Storage::ISCSIDirectPlugin;
|
use PVE::Storage::ISCSIDirectPlugin;
|
||||||
use PVE::Storage::GlusterfsPlugin;
|
use PVE::Storage::GlusterfsPlugin;
|
||||||
use PVE::Storage::ZFSDirPlugin;
|
use PVE::Storage::ZFSPoolPlugin;
|
||||||
use PVE::Storage::ZFSPlugin;
|
use PVE::Storage::ZFSPlugin;
|
||||||
|
|
||||||
# load and initialize all plugins
|
# load and initialize all plugins
|
||||||
@ -39,7 +39,7 @@ PVE::Storage::RBDPlugin->register();
|
|||||||
PVE::Storage::SheepdogPlugin->register();
|
PVE::Storage::SheepdogPlugin->register();
|
||||||
PVE::Storage::ISCSIDirectPlugin->register();
|
PVE::Storage::ISCSIDirectPlugin->register();
|
||||||
PVE::Storage::GlusterfsPlugin->register();
|
PVE::Storage::GlusterfsPlugin->register();
|
||||||
PVE::Storage::ZFSDirPlugin->register();
|
PVE::Storage::ZFSPoolPlugin->register();
|
||||||
PVE::Storage::ZFSPlugin->register();
|
PVE::Storage::ZFSPlugin->register();
|
||||||
PVE::Storage::Plugin->init();
|
PVE::Storage::Plugin->init();
|
||||||
|
|
||||||
|
|||||||
@ -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
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
|
|||||||
@ -5,9 +5,9 @@ use warnings;
|
|||||||
use IO::File;
|
use IO::File;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
use PVE::Tools qw(run_command);
|
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::Comstar;
|
||||||
use PVE::Storage::LunCmd::Istgt;
|
use PVE::Storage::LunCmd::Istgt;
|
||||||
use PVE::Storage::LunCmd::Iet;
|
use PVE::Storage::LunCmd::Iet;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
package PVE::Storage::ZFSDirPlugin;
|
package PVE::Storage::ZFSPoolPlugin;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
@ -11,15 +11,14 @@ use PVE::Storage::Plugin;
|
|||||||
use base qw(PVE::Storage::Plugin);
|
use base qw(PVE::Storage::Plugin);
|
||||||
|
|
||||||
sub type {
|
sub type {
|
||||||
return 'zfsdir';
|
return 'zfspool';
|
||||||
}
|
}
|
||||||
|
|
||||||
sub plugindata {
|
sub plugindata {
|
||||||
return {
|
return {
|
||||||
content => [ { images => 1, rootdir => 1, vztmpl => 1, iso => 1, backup => 1},
|
content => [ {images => 1}, { images => 1 }],
|
||||||
{ images => 1 }],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
sub properties {
|
sub properties {
|
||||||
return {
|
return {
|
||||||
@ -36,7 +35,6 @@ sub properties {
|
|||||||
|
|
||||||
sub options {
|
sub options {
|
||||||
return {
|
return {
|
||||||
path => { fixed => 1 },
|
|
||||||
pool => { fixed => 1 },
|
pool => { fixed => 1 },
|
||||||
blocksize => { optional => 1 },
|
blocksize => { optional => 1 },
|
||||||
sparse => { optional => 1 },
|
sparse => { optional => 1 },
|
||||||
@ -142,7 +140,7 @@ sub path {
|
|||||||
if($vtype eq "images"){
|
if($vtype eq "images"){
|
||||||
$path = "/dev/zvol/$scfg->{pool}/$volname";
|
$path = "/dev/zvol/$scfg->{pool}/$volname";
|
||||||
} else {
|
} else {
|
||||||
die "$vtype is not allowed in ZFSDir!";
|
die "$vtype is not allowed in ZFSPool!";
|
||||||
}
|
}
|
||||||
|
|
||||||
return ($path, $vmid, $vtype);
|
return ($path, $vmid, $vtype);
|
||||||
Reference in New Issue
Block a user