[pve-devel] [PATCH qemu-server v2 12/18] machine: get vm machine: fallback to creation QEMU version for windows starting with 9.1
Fiona Ebner
f.ebner at proxmox.com
Fri Jan 17 10:27:12 CET 2025
Am 17.01.25 um 10:19 schrieb Thomas Lamprecht:
> nit, if there will be a v3 I'd adapt the subject to:
>
> machine: fallback to creation QEMU version for windows starting with 9.1
>
> The additional tag did not provide much useful additional info IMO and
> made the subject rather long.
>
Ack
> Am 16.01.25 um 12:50 schrieb Fiona Ebner:
>> Starting from QEMU 9.1, pin to the creation version instead. Support
>> for machine version 5.1 is expected to drop with QEMU 11.1 and it
>> would still be good to handle Windows VMs that do not have explicit
>> machine version for whatever reason. For example, explicitly setting
>> the machine without a version on the CLI/API after creation is one way
>> to end up with such a machine.
>
> 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.
>> + 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.
More information about the pve-devel
mailing list