free_image: correctly check if base volume is not used

moved parse_volume_id to PVE::Storage::Plugin::parse_volume_id
This commit is contained in:
Dietmar Maurer
2013-01-31 11:36:49 +01:00
parent 188aca388e
commit a7f3d90919
2 changed files with 33 additions and 8 deletions

View File

@ -257,15 +257,10 @@ sub parse_vmid {
return int($vmid);
}
PVE::JSONSchema::register_format('pve-volume-id', \&parse_volume_id);
sub parse_volume_id {
my ($volid, $noerr) = @_;
if ($volid =~ m/^([a-z][a-z0-9\-\_\.]*[a-z0-9]):(.+)$/i) {
return wantarray ? ($1, $2) : $1;
}
return undef if $noerr;
die "unable to parse volume ID '$volid'\n";
return PVE::Storage::Plugin::parse_volume_id($volid, $noerr);
}
sub volume_is_base {