]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add HAP to xen hypervisor capabilities
authorJim Fehlig <jfehlig@novell.com>
Wed, 5 Jan 2011 22:20:01 +0000 (15:20 -0700)
committerJim Fehlig <jfehlig@novell.com>
Thu, 13 Jan 2011 16:30:26 +0000 (09:30 -0700)
xen-unstable c/s 16931 introduced a per-domain setting for hvm
guests to enable/disable hardware assisted paging.  If disabled,
software techniques such as shadow page tables are used.  If enabled,
and the feature exists in underlying hardware, hardware support for
paging is used.

Xen does not provide a mechanism to discover the HAP capability, so
we advertise its availability for hvm guests on Xen >= 3.3.

src/xen/xen_hypervisor.c

index ead8ee9b391eab40be02c360eddb029cbd2bb6fe..229ef3d4d519ac0e7ef8414b8b24aee10ac67597 100644 (file)
@@ -2321,6 +2321,16 @@ xenHypervisorBuildCapabilities(virConnectPtr conn,
                                                 hv_minor > 0 ?
                                                 0 : 1)) == NULL)
                 goto no_memory;
+
+            /* Xen 3.3.x and beyond supports enabling/disabling
+             * hardware assisted paging.  Default is off.
+             */
+            if ((hv_major == 3 && hv_minor >= 3) || (hv_major > 3))
+                if (virCapabilitiesAddGuestFeature(guest,
+                                                   "hap",
+                                                   0,
+                                                   1) == NULL)
+                    goto no_memory;
         }
     }