mirror of
git://git.proxmox.com/git/pve-storage.git
synced 2025-01-11 05:18:01 +03:00
get_vm_disk_number: follow up cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
f4cc2c4afe
commit
dd1fa860d0
@ -528,13 +528,15 @@ sub create_base {
|
||||
my $get_vm_disk_number = sub {
|
||||
my ($disk_name, $scfg, $vmid, $suffix) = @_;
|
||||
|
||||
my $disk_regex = qr/(vm|base)-$vmid-disk-(\d+)$suffix/;
|
||||
|
||||
my $type = $scfg->{type};
|
||||
my $def = { %{$defaultData->{plugindata}->{$type}} };
|
||||
my $valid_formats = $def->{format}[0];
|
||||
|
||||
my $disk_regex = qr/(vm|base)-$vmid-disk-(\d+)$suffix/;
|
||||
$disk_regex = qr/(vm|base|subvol|basevol)-$vmid-disk-(\d+)/
|
||||
if $valid_formats->{subvol};
|
||||
my $valid = $def->{format}[0];
|
||||
if ($valid->{subvol}) {
|
||||
$disk_regex = qr/(vm|base|subvol|basevol)-$vmid-disk-(\d+)/;
|
||||
}
|
||||
|
||||
if ($disk_name =~ m/$disk_regex/) {
|
||||
return $2;
|
||||
|
Loading…
Reference in New Issue
Block a user