[pve-devel] [PATCH storage] rbd: fix #4060 show data-pool usage when configured

Thomas Lamprecht t.lamprecht at proxmox.com
Wed May 18 08:19:19 CEST 2022


Am 5/17/22 um 16:07 schrieb Aaron Lauterer:
>>> diff --git a/PVE/Storage/RBDPlugin.pm b/PVE/Storage/RBDPlugin.pm
>>> index fb48c3f..da28e8a 100644
>>> --- a/PVE/Storage/RBDPlugin.pm
>>> +++ b/PVE/Storage/RBDPlugin.pm
>>> @@ -630,7 +630,8 @@ sub status {
>>>       my $rados = $librados_connect->($scfg, $storeid);
>>>       my $df = $rados->mon_command({ prefix => 'df', format => 'json' });
>>> -    my $pool =  $scfg->{pool} ? $scfg->{pool} : 'rbd';
>>> +    my $pool = $scfg->{'data-pool'} ? $scfg->{'data-pool'} : $scfg->{pool};
>>> +    $pool = 'rbd' if !$pool;
>>>       my ($d) = grep { $_->{name} eq $pool } @{$df->{pools}};
>>
>> without looking more closely at the surrounding code and how we
>> set/get those properties, wouldn't it also possble to do:
>>
>> my $pool = $scfg->{'data-pool'} // $scfg->{pool} // 'rbd';
>>
>> ?
> 
> Should work as well if it is okay stylewise. In the end, we want to get the pool name in that order.

Dominik's proposal would be fine(r) for me style wise.


More information about the pve-devel mailing list