use Data::Dumper;
use PVE::SafeSyslog;
-use PVE::Cluster qw(cfs_read_file);
+use PVE::Cluster;
use PVE::Storage;
use PVE::INotify;
use PVE::Exception qw(raise_param_exc);
my $storeid = $param->{storage};
- my $cfg = cfs_read_file("storage.cfg");
+ my $cfg = PVE::Storage::config();
my $vollist = PVE::Storage::volume_list($cfg, $storeid, $param->{vmid}, $param->{content});
my $res = [];
foreach my $item (@$vollist) {
- eval { $rpcenv->check_volume_access($authuser, $cfg, undef, $item->{volid}); };
+ eval { PVE::Storage::check_volume_access($rpcenv, $authuser, $cfg, undef, $item->{volid}); };
next if $@;
push @$res, $item;
}
$param->{format} = $fmt;
}
- my $cfg = cfs_read_file('storage.cfg');
+ my $cfg = PVE::Storage::config();
my $volid = PVE::Storage::vdisk_alloc ($cfg, $storeid, $param->{vmid},
$param->{format},
my ($volid, $storeid) = &$real_volume_id($param->{storage}, $param->{volume});
- my $cfg = cfs_read_file('storage.cfg');
+ my $cfg = PVE::Storage::config();
- $rpcenv->check_volume_access($authuser, $cfg, undef, $volid);
+ PVE::Storage::check_volume_access($rpcenv, $authuser, $cfg, undef, $volid);
my $path = PVE::Storage::path($cfg, $volid);
my ($size, $format, $used, $parent) = PVE::Storage::file_size_info($path);
my $rpcenv = PVE::RPCEnvironment::get();
my $authuser = $rpcenv->get_user();
- my $cfg = cfs_read_file('storage.cfg');
+ my $cfg = PVE::Storage::config();
my ($volid, $storeid) = &$real_volume_id($param->{storage}, $param->{volume});
print "DEBUG: COPY $src_volid TO $dst_volid\n";
- my $cfg = cfs_read_file('storage.cfg');
+ my $cfg = PVE::Storage::config();
# do all parameter checks first