[libvirt] [PATCH 2/3] Add support for CPU cache specification

Peter Krempa pkrempa at redhat.com
Thu Apr 27 14:26:27 UTC 2017


On Tue, Apr 25, 2017 at 20:48:44 +0200, Jiri Denemark wrote:
> This patch introduces
> 
>     <cache level='N' mode='emulate'/>
>     <cache mode='passthrough'/>
>     <cache mode='disable'/>
> 
> sub element of /domain/cpu. Currently only a single <cache> element is
> allowed.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
>  docs/formatdomain.html.in                          | 35 ++++++++++++
>  docs/schemas/cputypes.rng                          | 21 ++++++++
>  docs/schemas/domaincommon.rng                      |  3 ++
>  src/conf/cpu_conf.c                                | 62 ++++++++++++++++++++++
>  src/conf/cpu_conf.h                                | 19 +++++++
>  src/libvirt_private.syms                           |  2 +
>  .../generic-cpu-cache-disable.xml                  | 20 +++++++
>  .../generic-cpu-cache-emulate.xml                  | 20 +++++++
>  .../generic-cpu-cache-passthrough.xml              | 20 +++++++
>  .../generic-cpu-cache-disable.xml                  | 20 +++++++
>  .../generic-cpu-cache-emulate.xml                  | 20 +++++++
>  .../generic-cpu-cache-passthrough.xml              | 20 +++++++
>  tests/genericxml2xmltest.c                         |  4 ++
>  13 files changed, 266 insertions(+)
>  create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-disable.xml
>  create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-emulate.xml
>  create mode 100644 tests/genericxml2xmlindata/generic-cpu-cache-passthrough.xml
>  create mode 100644 tests/genericxml2xmloutdata/generic-cpu-cache-disable.xml
>  create mode 100644 tests/genericxml2xmloutdata/generic-cpu-cache-emulate.xml
>  create mode 100644 tests/genericxml2xmloutdata/generic-cpu-cache-passthrough.xml

[...]

> diff --git a/tests/genericxml2xmloutdata/generic-cpu-cache-disable.xml b/tests/genericxml2xmloutdata/generic-cpu-cache-disable.xml
> new file mode 100644

[...]

> diff --git a/tests/genericxml2xmloutdata/generic-cpu-cache-emulate.xml b/tests/genericxml2xmloutdata/generic-cpu-cache-emulate.xml
> new file mode 100644
> index 000000000..6ea57cbf6

[...]

> diff --git a/tests/genericxml2xmloutdata/generic-cpu-cache-passthrough.xml b/tests/genericxml2xmloutdata/generic-cpu-cache-passthrough.xml
> new file mode 100644
> index 000000000..8d4c186c9
> --- /dev/null
> +++ b/tests/genericxml2xmloutdata/generic-cpu-cache-passthrough.xml

You don't need any of the *out* files if you use ...

> @@ -0,0 +1,20 @@
> +<domain type='kvm'>
> +  <name>foo</name>
> +  <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
> +  <memory unit='KiB'>219136</memory>
> +  <currentMemory unit='KiB'>219136</currentMemory>
> +  <vcpu placement='static'>1</vcpu>
> +  <os>
> +    <type arch='i686' machine='pc'>hvm</type>
> +    <boot dev='hd'/>
> +  </os>
> +  <cpu mode='host-passthrough'>
> +    <cache mode='passthrough'/>
> +  </cpu>
> +  <clock offset='utc'/>
> +  <on_poweroff>destroy</on_poweroff>
> +  <on_reboot>restart</on_reboot>
> +  <on_crash>destroy</on_crash>
> +  <devices>
> +  </devices>
> +</domain>
> diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c
> index 1cda18cd9..5bce00e21 100644
> --- a/tests/genericxml2xmltest.c
> +++ b/tests/genericxml2xmltest.c
> @@ -100,6 +100,10 @@ mymain(void)
>  
>      DO_TEST("vcpus-individual");
>  
> +    DO_TEST("cpu-cache-emulate");
> +    DO_TEST("cpu-cache-passthrough");
> +    DO_TEST("cpu-cache-disable");

... DO_TEST. Only DO_TEST_DIFFERENT.

> +
>      virObjectUnref(caps);
>      virObjectUnref(xmlopt);

ACK if you drop the useless files.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170427/1ffd3268/attachment-0001.sig>


More information about the libvir-list mailing list