[pve-devel] [PATCH storage 6/9] ovf: implement rudimentary boot order

Dominik Csapak d.csapak at proxmox.com
Wed Apr 17 15:15:16 CEST 2024


On 4/17/24 13:54, Fiona Ebner wrote:
> Am 16.04.24 um 15:18 schrieb Dominik Csapak:
>> simply add all parsed disks to the boot order in the order we encounter
>> them (similar to the esxi plugin).
>>
>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>> ---
>>   src/PVE/Storage/OVF.pm    | 6 ++++++
>>   src/test/run_ovf_tests.pl | 3 +++
>>   2 files changed, 9 insertions(+)
>>
>> diff --git a/src/PVE/Storage/OVF.pm b/src/PVE/Storage/OVF.pm
>> index f56c34d..f438de2 100644
>> --- a/src/PVE/Storage/OVF.pm
>> +++ b/src/PVE/Storage/OVF.pm
>> @@ -245,6 +245,8 @@ sub parse_ovf {
>>       # when all the nodes has been found out, we copy the relevant information to
>>       # a $pve_disk hash ref, which we push to @disks;
>>   
>> +    my $boot = [];
> 
> Nit: might be better to name it more verbosely since it's a long
> function, e.g. boot_order, boot_disk_keys, or similar
> 
>> +
>>       foreach my $item_node (@disk_items) {
>>   
>>   	my $disk_node;
>> @@ -348,6 +350,10 @@ ovf:Item[rasd:InstanceID='%s']/rasd:ResourceType", $controller_id);
>>   	};
>>   	$pve_disk->{virtual_size} = $virtual_size if defined($virtual_size);
>>   	push @disks, $pve_disk;
>> +	push @$boot, $pve_disk_address;
>> +    }
> 
> This bracket should not be here and the next line below the next bracket
> (fixed by the next patch).
> 
>> +
>> +    $qm->{boot} = "order=" . join(';', @$boot);
> 
> Won't this fail later if there are no disks?

yes, oops, will check if boot(_order) is empty




More information about the pve-devel mailing list