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

Re: [libvirt] [PATCH v2 07/33] qemu: Fix CPU model fallback in domain capabilities




On 02/15/2017 11:44 AM, Jiri Denemark wrote:
> Our documentation of the domain capabilities XML says that the fallback
> attribute of a CPU model is used to indicate whether the CPU model was
> detected by libvirt itself (fallback="allow") or by asking the
> hypervisor (fallback="forbid"). We need to properly set
> fallback="forbid" when CPU model comes from QEMU to match the
> documentation.
> 
> Signed-off-by: Jiri Denemark <jdenemar redhat com>
> ---
> 
> Notes:
>     Version 2:
>     - no change
> 
>  src/qemu/qemu_capabilities.c                    | 3 +++
>  tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 2 +-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 0be2301cb..c511248bd 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -3103,6 +3103,9 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps,
>      if (ARCH_IS_S390(qemuCaps->arch))
>          ret = virQEMUCapsInitCPUModelS390(qemuCaps, cpu);

The following can "at this point in the series" only affect S390 since
'ret' is initialized to 1 beforehand.  So other arch's won't get this -
is that expected?

When patch 22 is applied X86 will get this, but it doesn't seem arm or
ppc64 would likewise (from my quick read and less than knowledgeable
view that assumes host-model fallback is supported for those).

ACK for what's here since it does alter the fallback value based on the
doc description.

John
>  
> +    if (ret == 0)
> +        cpu->fallback = VIR_CPU_FALLBACK_FORBID;
> +
>      return ret;
>  }
>  
> diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
> index efe345962..0b8135bc5 100644
> --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
> +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml
> @@ -21,7 +21,7 @@
>    <cpu>
>      <mode name='host-passthrough' supported='yes'/>
>      <mode name='host-model' supported='yes'>
> -      <model fallback='allow'>zEC12.2-base</model>
> +      <model fallback='forbid'>zEC12.2-base</model>
>        <feature policy='require' name='aefsi'/>
>        <feature policy='require' name='msa5'/>
>        <feature policy='require' name='msa4'/>
> 


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