[pve-devel] volume_has_feature question

Alexandre DERUMIER aderumier at odiso.com
Fri Feb 15 09:56:45 CET 2013


oh, sorry, you are right.

I had made a mistake when I rework my code.

It's indeed $key = 'snap'

I'll send you patches

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

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER (aderumier at odiso.com)" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Vendredi 15 Février 2013 08:36:41 
Objet: volume_has_feature question 

Hi Alexandre, 

I don't really understand the code in 'PVE::Storage::Plugin::volume_has_feature' 

---------------------------- 
sub volume_has_feature { 
my ($class, $scfg, $feature, $storeid, $volname, $snapname, $running) = @_; 

my $features = { 
snapshot => { current => { qcow2 => 1}, snap => { qcow2 => 1} }, 
clone => { base => {qcow2 => 1, raw => 1, vmdk => 1} }, 
copy => { base => {qcow2 => 1, raw => 1, vmdk => 1}, 
current => {qcow2 => 1, raw => 1, vmdk => 1}, 
snap => {qcow2 => 1} }, 
}; 

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

my (undef, $format) = parse_name_dir($name); 

my $key = undef; 
if($snapname){ 
$key = $snapname 
------------------------------------ 

I thought that should be "$key = 'snap'"? 



More information about the pve-devel mailing list