next diskname: start ids with 0 to honor MAX_VOLUMES_PER_GUEST

else we can only have MAX_VOLUMES_PER_GUEST-1 disk per VMID,
not tragic but possible confusing

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2018-09-10 10:07:44 +02:00
parent c0535aa72f
commit 59fa9fd6a3
2 changed files with 17 additions and 17 deletions

View File

@ -559,7 +559,7 @@ sub get_next_vm_diskname {
my $prefix = ($fmt eq 'subvol') ? 'subvol' : 'vm';
my $suffix = $add_fmt_suffix ? ".$fmt" : '';
for (my $i = 1; $i < $MAX_VOLUMES_PER_GUEST; $i++) {
for (my $i = 0; $i < $MAX_VOLUMES_PER_GUEST; $i++) {
if (!$disk_ids->{$i}) {
return "$prefix-$vmid-disk-$i$suffix";
}