Re: [PATCH v3 04/12] qemu: use canonical name for CPU models

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 15, 2023 at 04:12:00PM -0600, Jonathon Jongsma wrote:
> As described in detail in the commit "cpu_map: add canonical names to
> existing CPU models", the unversioned CPU model names are not
> migration-safe. If qemu makes the anticipated changes to CPU alias
> mapping, an unversioned CPU model may be represented by different
> underlying CPU models on different hosts. To avoid being susceptible to
> this issue, use the new 'canonical_name' property of the CPU definition
> to always specify a specific versioned CPU model version to qemu rather
> than using CPU model aliases.

The CPU models *are* migration safe because libvirt /always/ uses
the versioned machine type name.

> This canonical name is only used in the qemu backend and is not exposed
> to the user in anyway. The libvirt CPU configuration will continue to
> use existing unversioned model names in the domain xml for continuity.
> But internally we will translate these to a specific version.
> 
> Signed-off-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c                                      | 5 ++++-
>  tests/qemuxml2argvdata/cpu-Haswell-noTSX.x86_64-latest.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-Haswell.x86_64-latest.args        | 2 +-
>  tests/qemuxml2argvdata/cpu-Haswell2.x86_64-latest.args       | 2 +-
>  tests/qemuxml2argvdata/cpu-Haswell3.x86_64-latest.args       | 2 +-
>  .../cpu-Icelake-Server-pconfig.x86_64-latest.args            | 2 +-
>  tests/qemuxml2argvdata/cpu-cache-disable3.x86_64-latest.args | 2 +-
>  .../cpu-check-default-partial.x86_64-latest.args             | 2 +-
>  tests/qemuxml2argvdata/cpu-fallback.x86_64-5.2.0.args        | 2 +-
>  tests/qemuxml2argvdata/cpu-fallback.x86_64-8.0.0.args        | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-cmt.x86_64-latest.args | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-4.2.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-5.0.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-5.1.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-5.2.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-6.0.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-6.1.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-6.2.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-7.0.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-7.1.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-7.2.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-8.0.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-8.1.0.args            | 2 +-
>  .../cpu-host-model-fallback-kvm.x86_64-latest.args           | 2 +-
>  .../cpu-host-model-fallback-tcg.x86_64-7.2.0.args            | 2 +-
>  .../cpu-host-model-fallback-tcg.x86_64-8.0.0.args            | 2 +-
>  .../cpu-host-model-fallback-tcg.x86_64-8.1.0.args            | 2 +-
>  .../cpu-host-model-fallback-tcg.x86_64-latest.args           | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-4.2.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.0.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.1.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-5.2.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-6.0.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-6.1.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-6.2.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-7.0.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-7.1.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-7.2.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-8.0.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-8.1.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-kvm.x86_64-latest.args | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-4.2.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-5.0.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-5.1.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-5.2.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-6.0.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-6.1.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-6.2.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-7.0.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-7.1.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-7.2.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-8.0.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-8.1.0.args          | 2 +-
>  .../cpu-host-model-nofallback-kvm.x86_64-latest.args         | 2 +-
>  .../cpu-host-model-nofallback-tcg.x86_64-7.2.0.args          | 2 +-
>  .../cpu-host-model-nofallback-tcg.x86_64-8.0.0.args          | 2 +-
>  .../cpu-host-model-nofallback-tcg.x86_64-8.1.0.args          | 2 +-
>  .../cpu-host-model-nofallback-tcg.x86_64-latest.args         | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-7.2.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-8.0.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-8.1.0.args  | 2 +-
>  tests/qemuxml2argvdata/cpu-host-model-tcg.x86_64-latest.args | 2 +-
>  .../cpu-host-model-vendor.x86_64-latest.args                 | 2 +-
>  tests/qemuxml2argvdata/cpu-minimum1.x86_64-latest.args       | 2 +-
>  tests/qemuxml2argvdata/cpu-minimum2.x86_64-latest.args       | 2 +-
>  tests/qemuxml2argvdata/cpu-nofallback.x86_64-8.0.0.args      | 2 +-
>  .../cpu-phys-bits-emulate2.x86_64-latest.args                | 2 +-
>  tests/qemuxml2argvdata/cpu-strict1.x86_64-latest.args        | 2 +-
>  tests/qemuxml2argvdata/cpu-translation.x86_64-latest.args    | 2 +-
>  tests/qemuxml2argvdata/cpu-tsc-frequency.x86_64-latest.args  | 2 +-
>  70 files changed, 73 insertions(+), 70 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index 54fb8220e8..be9cbe4915 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -6267,7 +6267,10 @@ qemuBuildCpuModelArgStr(virQEMUDriver *driver,
>          break;
>  
>      case VIR_CPU_MODE_CUSTOM:
> -        virBufferAdd(buf, cpu->model, -1);
> +        if (cpu->canonical_model)
> +            virBufferAdd(buf, cpu->canonical_model, -1);
> +        else
> +            virBufferAdd(buf, cpu->model, -1);
>          break;

This isn't checking whether QEMU supports the versioned CPU
model or not.

QEMU has had 'Haswell-noTSX' long before 'Haswell-v2' was
added.

Can you check what version QEMU introduced CPU versions,
and whether that's /equal or older/ than our minimum
QEMU version. Assuming it is, then record this in the
commit message as justification for why this doesn't
break compatibility with launching old QEMU.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux