[pve-devel] [PATCH storage 2/5] Diskmanage: allow get_disks to take multiple disks

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jun 4 10:30:40 CEST 2019


On 6/4/19 10:25 AM, Dominik Csapak wrote:
> On 6/4/19 10:08 AM, Thomas Lamprecht wrote:
>> On 6/4/19 9:21 AM, Dominik Csapak wrote:
>>> [snip]
>>> +    if (defined($disks)) {
>>> +    if (!ref($disks) || ref($disks) ne 'ARRAY') {
>>
>> .. || ref($disk) eq 'SCALAR'
>>
>> as all else doe not makes sense, or?
> 
> on further thought, only the !ref($disks) makes any sense
> (since we do not do any dereferencing)
> and we should probably do something like
> 
> if (!ref) {
>  disks = [ disks ];
> } else if (ref != array) {
>   die 'disks is not a string or arrayref';
> }
> 

yes, makes more sense.





More information about the pve-devel mailing list