conf: Parse and format nested-hv feature

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Andrea Bolognani 2018-11-20 14:57:27 +01:00
parent 0029eace52
commit bfa2bd7e38
7 changed files with 25 additions and 0 deletions

View File

@ -2295,6 +2295,18 @@
defined, the hypervisor default will be used.
<span class="since">Since 4.6.0</span> (QEMU/KVM only)
</dd>
<dt><code>nested-hv</code></dt>
<dd>Configure nested HV availability for pSeries guests. This needs to
be enabled from the host (L0) in order to be effective; having HV
support in the (L1) guest is very desiderable if it's planned to
run nested (L2) guests inside it, because it will result in those
nested guests having much better performance than they would when
using KVM PR or TCG.
Possible values for the <code>state</code> attribute are
<code>on</code> and <code>off</code>. If the attribute is not
defined, the hypervisor default will be used.
<span class="since">Since 4.10.0</span> (QEMU/KVM only)
</dd>
</dl>
<h3><a id="elementsTime">Time keeping</a></h3>

View File

@ -4978,6 +4978,11 @@
<ref name="featurestate"/>
</element>
</optional>
<optional>
<element name="nested-hv">
<ref name="featurestate"/>
</element>
</optional>
</interleave>
</element>
</optional>

View File

@ -154,6 +154,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
"hpt",
"vmcoreinfo",
"htm",
"nested-hv",
);
VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
@ -20159,6 +20160,7 @@ virDomainDefParseXML(xmlDocPtr xml,
break;
case VIR_DOMAIN_FEATURE_HTM:
case VIR_DOMAIN_FEATURE_NESTED_HV:
if (!(tmp = virXMLPropString(nodes[i], "state"))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("missing state attribute '%s' of feature '%s'"),
@ -22321,6 +22323,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
case VIR_DOMAIN_FEATURE_SMM:
case VIR_DOMAIN_FEATURE_VMCOREINFO:
case VIR_DOMAIN_FEATURE_HTM:
case VIR_DOMAIN_FEATURE_NESTED_HV:
if (src->features[i] != dst->features[i]) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("State of feature '%s' differs: "
@ -28236,6 +28239,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
case VIR_DOMAIN_FEATURE_PVSPINLOCK:
case VIR_DOMAIN_FEATURE_VMPORT:
case VIR_DOMAIN_FEATURE_HTM:
case VIR_DOMAIN_FEATURE_NESTED_HV:
switch ((virTristateSwitch) def->features[i]) {
case VIR_TRISTATE_SWITCH_LAST:
case VIR_TRISTATE_SWITCH_ABSENT:

View File

@ -1778,6 +1778,7 @@ typedef enum {
VIR_DOMAIN_FEATURE_HPT,
VIR_DOMAIN_FEATURE_VMCOREINFO,
VIR_DOMAIN_FEATURE_HTM,
VIR_DOMAIN_FEATURE_NESTED_HV,
VIR_DOMAIN_FEATURE_LAST
} virDomainFeature;

View File

@ -3890,6 +3890,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
case VIR_DOMAIN_FEATURE_HPT:
case VIR_DOMAIN_FEATURE_HTM:
case VIR_DOMAIN_FEATURE_NESTED_HV:
if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
!qemuDomainIsPSeries(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,

View File

@ -11,6 +11,7 @@
<maxpagesize unit='GiB'>1</maxpagesize>
</hpt>
<htm state='on'/>
<nested-hv state='off'/>
</features>
<devices>
<emulator>/usr/bin/qemu-system-ppc64</emulator>

View File

@ -13,6 +13,7 @@
<maxpagesize unit='KiB'>1048576</maxpagesize>
</hpt>
<htm state='on'/>
<nested-hv state='off'/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>