Joao Martins wrote:
On 03/01/2016 04:00 AM, Jim Fehlig wrote:
> Most hypervisors use Hardware Assisted Paging by default and don't
> require specifying the feature in domain conf. But some hypervisors
> support disabling HAP on a per-domain basis. To enable HAP by default
> yet provide a knob to disable it, extend the <hap> feature with a
> 'state=on|off' attribute, similar to <pvspinlock> and <vmport>
features.
>
> In the absence of <hap>, the hypervisor default (on) is used. <hap>
> without the state attribute would be the same as <hap state='on'/> for
> backwards compatibility. And of course <hap state='off'/> disables
hap.
>
> Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
> ---
> docs/formatdomain.html.in | 6 ++++--
> docs/schemas/domaincommon.rng | 6 +++++-
> src/conf/domain_conf.c | 4 ++--
> 3 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
> index 5016772..c06bcf3 100644
> --- a/docs/formatdomain.html.in
> +++ b/docs/formatdomain.html.in
> @@ -1494,8 +1494,10 @@
> Interrupt) for the guest.
> </dd>
> <dt><code>hap</code></dt>
> - <dd>Enable use of Hardware Assisted Paging if available in
> - the hardware.
> + <dd>Depending on the <code>state</code> attribute (values
<code>on</code>,
> + <code>off</code>) enable or disable use of Hardware Assisted
Paging.
> + The default is <code>on</code> if the hypervisor detects
availability
> + of Hardware Assisted Paging.
> </dd>
> <dt><code>viridian</code></dt>
> <dd>Enable Viridian hypervisor extensions for paravirtualizing
> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
> index 67af93a..dd6e93a 100644
> --- a/docs/schemas/domaincommon.rng
> +++ b/docs/schemas/domaincommon.rng
> @@ -4108,7 +4108,11 @@
> </optional>
> <optional>
> <element name="hap">
> - <empty/>
> + <optional>
> + <attribute name="state">
> + <ref name="virOnOff"/>
> + </attribute>
> + </optional>
Perhaps <ref name="featurestate"/> would be better (see chunk below) ?
That one
appears to be a reference of what you are adding above, and it's the same as
pvspinlock. Though some other elements don't appear to use this, not sure why.
Ah, thanks for catching that. 'featurestate' is definitely the better choice
here.
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 89d3a6b..141122c 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -4132,9 +4132,7 @@
<optional>
<element name="hap">
<optional>
- <attribute name="state">
- <ref name="virOnOff"/>
- </attribute>
+ <ref name="featurestate"/>
</optional>
</element>
</optional>
Other that,
Reviewed-by: Joao Martins <joao.m.martins(a)oracle.com>
Thanks. I've squashed in your diff, but should probably wait for any additional
comments before pushing this series.
Regards,
Jim