foreach volid helper: make $pending parameter behave like a boolean

Avoids potential future mistake with passing in an explicit 0.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2023-06-21 12:20:57 +02:00
parent ee2febbaa0
commit 219719aada

View File

@ -4865,12 +4865,12 @@ sub foreach_volid {
$volhash->{$volid}->{is_attached} //= 0; $volhash->{$volid}->{is_attached} //= 0;
$volhash->{$volid}->{is_attached} = 1 $volhash->{$volid}->{is_attached} = 1
if !$volhash->{$volid}->{is_unused} && !defined($snapname) && !defined($pending); if !$volhash->{$volid}->{is_unused} && !defined($snapname) && !$pending;
$volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1 $volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1
if defined($snapname); if defined($snapname);
$volhash->{$volid}->{referenced_in_pending} = 1 if defined($pending); $volhash->{$volid}->{referenced_in_pending} = 1 if $pending;
my $size = $drive->{size}; my $size = $drive->{size};
$volhash->{$volid}->{size} //= $size if $size; $volhash->{$volid}->{size} //= $size if $size;