Am 31.01.25 um 14:58 schrieb Daniel Herzig:
> Fiona Ebner <f.eb...@proxmox.com> writes:
> 
>> Am 31.01.25 um 10:36 schrieb Fiona Ebner:
>>> Am 30.01.25 um 12:31 schrieb Daniel Herzig:
>>>> +
>>>> +    $drive->{essential} = 1 if !defined($drive->{essential});
>>>
>>> This should rather be done when parsing the drive.
>>
>> Or I guess to avoid (potentially) writing it out for every drive, it
>> should only be a local variable here and not set in the drive hash.
> 
> Thanks, I'll double check on this for v4. But I'd assume the hash to be 
> scoped to
> `config_to_command` here, or am I missing something?
> 

But you don't need the modified version in config_to_command() later,
or? And if yes, that can just check the same way again, i.e. using
default value if not set. If we want to explicitly set the value, that
should happen during parsing the drive string. Most of the time it's
surprising to implicitly modify a passed-in value. Better to either
avoid that or if really necessary, explicitly mention it in the function
description.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to