[pve-devel] [PATCH v4 qemu-server 4/12] qemuserver: foreach_volid: test regular config last

Fiona Ebner f.ebner at proxmox.com
Fri Jun 16 14:40:05 CEST 2023


Am 16.06.23 um 11:57 schrieb Aaron Lauterer:
> after snapshots and the pending section to make sure, that volids that
> are referenced here, will be marked correctly, e.g. 'is_unused'.
> 

The flag is set as follows:

>         $volhash->{$volid}->{is_unused} //= 0;
>         $volhash->{$volid}->{is_unused} = 1 if $key =~ /^unused\d+$/;

So why would the order matter? Once it's set to 1 it won't change.

On the other hand

>         my $size = $drive->{size};
>         $volhash->{$volid}->{size} //= $size if $size;

the first size wins, so with your change, the size in a snapshot will
win. I'm not sure we use this attribute anywhere though, might be worth
checking and dropping if not.





More information about the pve-devel mailing list