[pve-devel] [PATCH qemu-server 4/4] cpu config: Unify the default value for 'kvm'

Fiona Ebner f.ebner at proxmox.com
Thu Feb 22 10:35:26 CET 2024

Am 21.02.24 um 16:39 schrieb Filip Schauer:
> On 19/02/2024 15:47, Fiona Ebner wrote:
>> On an x86_64 host, for guests using a different architecture (i.e.
>> aarch64), hot-plugging is already broken, because we try to hotplug a
>> CPU of type "$cpu-x86_64-cpu,XYZ" which won't work anyways:
>> vcpus: hotplug problem - VM 130 qmp command 'device_add' failed -
>> 'kvm64-x86_64-cpu' is not a valid device model name
>> The actual breaking change is for the host arch being something other
>> than x86_64 (which isn't officially supported) and the VM being
>> x86_64, ...
>>> @@ -414,9 +415,9 @@ sub get_custom_model {
>>>     # Print a QEMU device node for a given VM configuration for
>>> hotplugging CPUs
>>>   sub print_cpu_device {
>>> -    my ($conf, $id) = @_;
>>> +    my ($conf, $arch, $id) = @_;
>>>   -    my $kvm = $conf->{kvm} // 1;
>>> +    my $kvm = $conf->{kvm} // is_native($arch);
>>>       my $cpu = get_default_cpu_type('x86_64', $kvm);
>> ...because in that case, before this patch we got kvm64 here, but with
>> the patch we get qemu64 which would be a problem for live-migration.
> I expressed my opinion on this matter in the following mail:
> https://lists.proxmox.com/pipermail/pve-devel/2023-December/061131.html

Yes, I also think the change is fine. But breaking ARM64 guests on a
x86_64 host would not be fine. The point is CPU hotplug already doesn't
work here, so the commit message should be adapted to mention that.

I saw you completely removed the commit message in v8. Should be added
back with the additional information, but that alone doesn't warrant a
v9, can also be done when applying.

More information about the pve-devel mailing list