]> git.proxmox.com Git - pve-access-control.git/commitdiff
check_volume_access : use parse_volname instead path
authorAlexandre Derumier <aderumier@odiso.com>
Wed, 25 Sep 2013 08:27:43 +0000 (10:27 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 1 Oct 2013 09:40:57 +0000 (11:40 +0200)
to avoid extra calls for some storageplugins (zfs,nexenta).

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
PVE/RPCEnvironment.pm

index 765008eee5c63a5ee0b3ae591c25da372f770153..ca845f0f8b5efe8aaba3b6471bee860847eca17d 100644 (file)
@@ -290,8 +290,7 @@ sub check_volume_access {
     my $path;
     my ($sid, $volname) = PVE::Storage::parse_volume_id($volid, 1);
     if ($sid) {
     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)) {
        if ($vtype eq 'iso' || $vtype eq 'vztmpl') {
            # we simply allow access 
        } elsif (defined($ownervm) && defined($vmid) && ($ownervm == $vmid)) {