5
0
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:
Thomas Lamprecht 2018-09-14 09:17:06 +02:00
parent f4cc2c4afe
commit dd1fa860d0

View File

@ -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;