[pve-devel] [PATCH v5 qemu-server 1/10] qemuserver: foreach_volid: include pending volumes

Fiona Ebner f.ebner at proxmox.com
Mon Jun 19 14:20:59 CEST 2023


Am 19.06.23 um 11:29 schrieb Aaron Lauterer:
>  
> @@ -4876,11 +4876,13 @@ sub foreach_volid {
>  	$volhash->{$volid}->{shared} = 1 if $drive->{shared};
>  
>  	$volhash->{$volid}->{referenced_in_config} //= 0;
> -	$volhash->{$volid}->{referenced_in_config} = 1 if !defined($snapname);
> +	$volhash->{$volid}->{referenced_in_config} = 1 if !defined($snapname) && !defined($pending);

Nit: I would've made $pending behave like a boolean, i.e. check for
$pending rather than defined($pending). $snapname is a string, so there
one wouldn't accidentally pass in an explicit 0.

>  
>  	$volhash->{$volid}->{referenced_in_snapshot}->{$snapname} = 1
>  	    if defined($snapname);
>  
> +	$volhash->{$volid}->{referenced_in_pending} = 1 if defined($pending);
> +

Same.





More information about the pve-devel mailing list