[pve-devel] [PATCH v2 common 2/3] section config: implement array support

Dominik Csapak d.csapak at proxmox.com
Mon May 15 11:19:02 CEST 2023


On 5/15/23 11:07, Wolfgang Bumiller wrote:
> On Fri, May 12, 2023 at 02:23:49PM +0200, Dominik Csapak wrote:
>> enables section configs in the style of:
>>
>> ----
>> type: id
>>      property value
>>      property value2
>>      property value3
>> ----
>>
>> can be combined with property strings
>>
>> the provided create and update schema just pass through the array type
>> to the api, so the api call must always contain the complete array
>>
>> also adds a test case for such array fields
>>
>> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
>> ---
>> changes from v1:
>> * don't special encode arrays anymore, but instead have always the whole
>>    array as parameter in the create/updateSchema
>>   src/PVE/SectionConfig.pm    | 64 +++++++++++++++++++++++++++----------
>>   test/section_config_test.pl | 26 +++++++++++++++
>>   2 files changed, 74 insertions(+), 16 deletions(-)
>>
>> diff --git a/src/PVE/SectionConfig.pm b/src/PVE/SectionConfig.pm
>> index f36cede..03f6a52 100644
>> --- a/src/PVE/SectionConfig.pm
>> +++ b/src/PVE/SectionConfig.pm
>> @@ -51,6 +51,17 @@ sub plugindata {
>>       return {};
>>   }
>>   
>> +my $copy_property = sub {
> 
> If you're moving it, maybe *re*move it and change the single
> caller of it to just do `{ %$src }`, since that's all this does ;-)
> 

oops, i used it in the v1, now not anymore, forgot to remove the hunks ;)
but can do in a v3 as a separate patch






More information about the pve-devel mailing list