[pve-devel] [PATCH] check_volume_access : use parse_volname instead path

Alexandre Derumier aderumier at odiso.com
Wed Sep 25 10:27:43 CEST 2013


to avoid extra calls for some storageplugins (zfs,nexenta).

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/RPCEnvironment.pm |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/PVE/RPCEnvironment.pm b/PVE/RPCEnvironment.pm
index 765008e..ca845f0 100644
--- a/PVE/RPCEnvironment.pm
+++ b/PVE/RPCEnvironment.pm
@@ -290,8 +290,7 @@ sub check_volume_access {
     my $path;
     my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
     if ($sid) {
-	my ($ownervm, $vtype);
-	($path, $ownervm, $vtype) = PVE::Storage::path($storecfg, $volid);
+	my ($vtype, undef, $ownervm) = PVE::Storage::parse_volname($storecfg, $volid);
 	if ($vtype eq 'iso' || $vtype eq 'vztmpl') {
 	    # we simply allow access 
 	} elsif (defined($ownervm) && defined($vmid) && ($ownervm == $vmid)) {
-- 
1.7.10.4




More information about the pve-devel mailing list