Am 17.01.25 um 10:27 schrieb Fiona Ebner:
> Am 17.01.25 um 10:19 schrieb Thomas Lamprecht:
>> But wouldn't the machine version jump from 5.1 to creation-QEMU with your
>> change for any VM that was created via CLI/API without explicit machine
>> version but with the code that adds the creation QEMU meta-info already
>> deployed?
> 
> No, the version will still be 5.1, except if the creation-QEMU version
> is >= 9.1.

ack, thanks for the hint. 
>>> +       my $base_version = '5.1';
>>> +       # TODO PVE 10 - die early if there is a Windows VM both without 
>>> explicit machine version
>>> +       # and without meta info.
>>> +       if (my $meta = 
>>> PVE::QemuServer::MetaInfo::parse_meta_info($conf->{meta})) {
>>> +           $base_version = $meta->{'creation-qemu'}
>>> +               if 
>>> PVE::QemuServer::Helpers::min_version($meta->{'creation-qemu'}, 9, 1);
>>> +           ($base_version) = ($base_version =~ m/^(\d+.\d+)/); # need only 
>>> major.minor
>>> +       }
>>> +       $machine = windows_get_pinned_machine_version($machine, 
>>> $base_version, $kvmversion);
> 
> The conditional might be better written up-front, not as a post-if and
> also cover the regex matching expression.

Ah yes, that probably would have helped me grasping this quicker.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to