[pve-devel] pve-storage : path : add checkaccess param

Alexandre DERUMIER aderumier at odiso.com
Wed Sep 25 08:00:40 CEST 2013


>>So we just need to make that method accessible from outside: 
>>
>>my ($vtype, $name, $ownervm) = PVE::Storage::parse_volname($cfg, $volid) 

>>Do you think that would work? 

Yes, but check_volume_access return need $path in 2 places

OpenVZ.pm

$archive = $rpcenv->check_volume_access($authuser, $storage_cfg, $vmid, $ostemplate);
die "can't find file '$archive'\n" if ! -f $archive;


Qemu.pm

my $path = $rpcenv->check_volume_access($authuser, $storecfg, $vmid, $archive);

PVE::Storage::activate_volumes($storecfg, [ $archive ])
          if PVE::Storage::parse_volume_id ($archive, 1);


Do you have an idea how to implement ?

----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre Derumier" <aderumier at odiso.com>, pve-devel at pve.proxmox.com 
Envoyé: Mercredi 25 Septembre 2013 07:04:53 
Objet: RE: [pve-devel] pve-storage : path : add checkaccess param 

We already have: 

my ($vtype, $name, $vmid, $basename, $basevmid, $isBase) = 
$plugin->parse_volname($volname); 

So we just need to make that method accessible from outside: 

my ($vtype, $name, $ownervm) = PVE::Storage::parse_volname($cfg, $volid) 

Do you think that would work? 

> RPCEnvironnement:check_volume_access only need $path for real file. 



More information about the pve-devel mailing list