[pve-devel] [PATCH pve-storage 08/10] qcow2: add external snapshot support
DERUMIER, Alexandre
alexandre.derumier at groupe-cyllene.com
Tue Jul 8 15:42:08 CEST 2025
>>okay, that means we instead need to become more strict with 'snapext'
>>storages and restrict the volnames there.. maybe to (vm-|base-)-XXX-
>>*.fmt?
$plugin->parse_volname($volname) don't have $scfg param currently,
Do you want to extend it ? (and do change in every plugin)
or can I call
my ($storeid, $volname) = parse_volume_id($volid);
my $scfg = storage_config($cfg, $storeid);
in the Plugin::parse_namedir ?
sub parse_name_dir {
my $name = shift;
if ($scfg->{'external-snapshots'} && $name =~ m/^((vm|base)-(\d+)-
\S+\.(raw|qcow2|vmdk|subvol))$/) {
return ($1, $4, $2 eq 'base'); # (name, format, isBase)
} elsif ($name =~ m!^((base-)?[^/\s]+\.(raw|qcow2|vmdk|subvol))$!)
{
return ($1, $3, $2); # (name, format, isBase)
}
die "unable to parse volume filename '$name'\n";
}
More information about the pve-devel
mailing list