--- Begin Message ---
>>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";
}






--- End Message ---
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to