[libvirt] [PATCH 28/41] Show host model in domain capabilities

John Ferlan jferlan at redhat.com
Tue Aug 30 14:49:25 UTC 2016



On 08/12/2016 09:33 AM, Jiri Denemark wrote:
> The domain capabilities XML is capable of showing whether each guest CPU
> mode is supported or not with a possibility to provide additional
> details. This patch enhances host-model capability to advertise the
> exact CPU model which will be used as a host-model:
> 
>     <cpu>
>         ...
>         <mode name='host-model' supported='yes'>
>             <model fallback='allow'>Broadwell</model>
>             <vendor>Intel</vendor>
>             <feature policy='disable' name='aes'/>
>             <feature policy='require' name='vmx'/>
>         </mode>
>         ...
>     </cpu>
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  docs/formatdomaincaps.html.in                       | 21 +++++++++++++++++++--
>  docs/schemas/domaincaps.rng                         | 10 ++++++++++
>  src/conf/domain_capabilities.c                      | 16 +++++++++++++---
>  src/conf/domain_capabilities.h                      |  2 +-
>  src/qemu/qemu_capabilities.c                        |  4 +---
>  tests/domaincapsschemadata/full.xml                 |  5 ++++-
>  tests/domaincapsschemadata/qemu_1.7.0.x86_64.xml    |  4 +++-
>  .../qemu_2.6.0-gicv2-virt.aarch64.xml               |  2 +-
>  .../qemu_2.6.0-gicv3-virt.aarch64.xml               |  2 +-
>  tests/domaincapsschemadata/qemu_2.6.0.aarch64.xml   |  2 +-
>  tests/domaincapsschemadata/qemu_2.6.0.ppc64le.xml   |  4 +++-
>  tests/domaincapsschemadata/qemu_2.6.0.x86_64.xml    |  4 +++-
>  tests/domaincapstest.c                              | 10 ++++++++--
>  13 files changed, 68 insertions(+), 18 deletions(-)
> 

Hmmm... I guess we are displaying the cpuModel data - it just wasn't
"obvious" previously...

> diff --git a/docs/formatdomaincaps.html.in b/docs/formatdomaincaps.html.in
> index 49ccbfc..34eb777 100644
> --- a/docs/formatdomaincaps.html.in
> +++ b/docs/formatdomaincaps.html.in
> @@ -154,7 +154,12 @@
>    ...
>    <cpu>
>      <mode name='host-passthrough' supported='yes'/>
> -    <mode name='host-model' supported='yes'/>
> +    <mode name='host-model' supported='yes'>
> +      <model fallback='allow'>Broadwell</model>
> +      <vendor>Intel</vendor>
> +      <feature policy='disable' name='aes'/>
> +      <feature policy='require' name='vmx'/>
> +    </mode>
>      <mode name='custom' supported='yes'>
>        <model usable='no'>Broadwell</model>
>        <model usable='yes'>Broadwell-noTSX</model>
> @@ -177,7 +182,19 @@
>        <dd>No mode specific details are provided.</dd>
>  
>        <dt><code>host-model</code></dt>
> -      <dd>No mode specific details are provided yet.</dd>
> +      <dd>
> +        If <code>host-model</code> is supported by the hypervisor, the
> +        <code>mode</code> describes the guest CPU which will be used when
> +        starting a domain with <code>host-model</code> CPU. The hypervisor
> +        specifics (such as unsupported CPU models or features, machine type,
> +        etc.) may be accounted for in this guest CPU specification and thus
> +        the CPU can be different from the one shown in host capabilities XML.
> +        This is indicated by the <code>fallback</code> attribute of the
> +        <code>model</code> sub element: <code>allow</code> means not all
> +        specifics were accounted for and thus the CPU a guest will see may
> +        be different; <code>forbid</code> says that the CPU a guest will see

s/says/indicates

> +        should match this CPU definition.
> +      </dd>

Should this make a reference to

   http://libvirt.org/formatdomain.html#elementsCPU

since that's the allow/forbid and 'host-model' for the domain description?

Too bad there weren't any easily crafted 'forbid' examples for test...

>  
>        <dt><code>custom</code></dt>
>        <dd>

[...]




More information about the libvir-list mailing list