[pve-devel] [PATCH qemu-server] Properly identify the CPU architecture of 32-bit VMs

Fiona Ebner f.ebner at proxmox.com
Thu Dec 14 10:13:02 CET 2023


Am 13.12.23 um 18:31 schrieb Filip Schauer:
> On 12/12/2023 12:48, Fiona Ebner wrote:
>> Am 12.12.23 um 11:39 schrieb Filip Schauer:
>>> It's actually not a different binary. qemu-system-i386 is a symlink that
>>> points to qemu-system-x86_64. But still this does indeed break migration
>>> between a node that has this patch applied and another node without the
>>> patch.
>>>
>> Oh, okay. But then that's a bit surprising. From a quick glance, we do
>> have some logic matching arch 'x86_64' specifically in CPUConfig.pm, so
>> that might be it. E.g.:
>>
>>>      my $pve_forced_flags = {};
>>>      $pve_forced_flags->{'enforce'} = {
>>>          reason => "error if requested CPU settings not available",
>>>      } if $cputype ne 'host' && $kvm && $arch eq 'x86_64';
> 
> 
> This check does not make any difference in my case since $kvm is not set
> when using a qemu32 CPU.
> 

Well, that is just one example for such a flag, there are others ;)

>From a quick look, if kvm is not explicitly turned off in the config and
if you are not using arch i386/aarch64 in the config, the $kvm option
will get set. It does not seem to depend on the CPU type:

> sub is_native($) {
>     my ($arch) = @_;
>     return get_host_arch() eq $arch;
> }   
>                         
> sub get_vm_arch {
>     my ($conf) = @_;
>     return $conf->{arch} // get_host_arch();
> }   

> sub config_to_command {

...

>     my $kvm = $conf->{kvm};
>     my $nodename = nodename();
>     
>     my $arch = get_vm_arch($conf);

...

>     $kvm //= 1 if is_native($arch);

If you really want to know what causes the issue, you can compare the
QEMU commandline on source and target of the migration.




More information about the pve-devel mailing list