]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: add 'state' attribute to <hap> feature
authorJim Fehlig <jfehlig@suse.com>
Tue, 23 Feb 2016 00:03:21 +0000 (17:03 -0700)
committerJim Fehlig <jfehlig@suse.com>
Mon, 21 Mar 2016 15:28:17 +0000 (09:28 -0600)
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@suse.com>
docs/formatdomain.html.in
docs/schemas/domaincommon.rng
src/conf/domain_conf.c

index 423dcdc1e27d80a6409e6a2b4c07e873429c09a6..71ffe750452eb77020689a8bdde16190be6c384f 100644 (file)
       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
index 0eb1e5ad727606ad848db8e77b909d43ef056c1e..da6de40f87640cbff2e0cc46b265d1ed0a59b9a7 100644 (file)
           </optional>
           <optional>
             <element name="hap">
-              <empty/>
+              <optional>
+                <attribute name="state">
+                  <ref name="virOnOff"/>
+                </attribute>
+              </optional>
             </element>
           </optional>
           <optional>
index 43b2f1f005868064e3c315b77cadcea950b95e01..d5d9ff702f4269be66a4009d91644ce090c90c27 100644 (file)
@@ -15497,7 +15497,6 @@ virDomainDefParseXML(xmlDocPtr xml,
             /* fallthrough */
         case VIR_DOMAIN_FEATURE_ACPI:
         case VIR_DOMAIN_FEATURE_PAE:
-        case VIR_DOMAIN_FEATURE_HAP:
         case VIR_DOMAIN_FEATURE_VIRIDIAN:
         case VIR_DOMAIN_FEATURE_PRIVNET:
         case VIR_DOMAIN_FEATURE_HYPERV:
@@ -15522,6 +15521,7 @@ virDomainDefParseXML(xmlDocPtr xml,
             ctxt->node = node;
             break;
 
+        case VIR_DOMAIN_FEATURE_HAP:
         case VIR_DOMAIN_FEATURE_PMU:
         case VIR_DOMAIN_FEATURE_PVSPINLOCK:
         case VIR_DOMAIN_FEATURE_VMPORT:
@@ -22288,7 +22288,6 @@ virDomainDefFormatInternal(virDomainDefPtr def,
             switch ((virDomainFeature) i) {
             case VIR_DOMAIN_FEATURE_ACPI:
             case VIR_DOMAIN_FEATURE_PAE:
-            case VIR_DOMAIN_FEATURE_HAP:
             case VIR_DOMAIN_FEATURE_VIRIDIAN:
             case VIR_DOMAIN_FEATURE_PRIVNET:
                 switch ((virTristateSwitch) def->features[i]) {
@@ -22310,6 +22309,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
 
                 break;
 
+            case VIR_DOMAIN_FEATURE_HAP:
             case VIR_DOMAIN_FEATURE_PMU:
             case VIR_DOMAIN_FEATURE_PVSPINLOCK:
             case VIR_DOMAIN_FEATURE_VMPORT: