cpu config: fix get_cpu_bitness always reverting to default cpu type

This fixes the broken prevention of starting a VM with a 32-bit CPU
using a 64-bit OVMF (UEFI) BIOS.

Fixes: 89d5b1c9 ("prevent starting a 32-bit VM using a 64-bit OVMF BIOS")
Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
[FE: add Fixes trailer, add prefix to title]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Filip Schauer 2024-04-24 11:14:33 +02:00 committed by Fiona Ebner
parent c82cb51590
commit 67dca4238b

View File

@ -757,7 +757,7 @@ sub get_cpu_bitness {
my $cpu = PVE::JSONSchema::parse_property_string('pve-vm-cpu-conf', $cpu_prop_str)
or die "Cannot parse cpu description: $cpu_prop_str\n";
my $cputype = $cpu->{cputype};
$cputype = $cpu->{cputype};
if (my $model = $builtin_models->{$cputype}) {
$cputype = $model->{'reported-model'};