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

Aaron Lauterer a.lauterer at proxmox.com
Fri Jun 16 16:36:44 CEST 2023



On 6/16/23 14:40, Fiona Ebner wrote:
> 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.

yep. I did check the behavior after we talked. 'unusedX' will not end up in a 
snapshot and if we detach a disk from a running VM with disk hotplugging 
disabled, it will become a pending change in the form:
delete: scsi4

So we should also not expect 'unusedX' there. Therefore I think we can drop this 
patch.

> 
> 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