render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9c6c51
From 742667e7f0a55f3a8042840e2995982a003dc2fc Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <742667e7f0a55f3a8042840e2995982a003dc2fc@dist-git>
9c6c51
From: Andrea Bolognani <abologna@redhat.com>
9c6c51
Date: Tue, 4 Dec 2018 16:46:19 +0100
9c6c51
Subject: [PATCH] conf: Parse and format nested-hv feature
9c6c51
MIME-Version: 1.0
9c6c51
Content-Type: text/plain; charset=UTF-8
9c6c51
Content-Transfer-Encoding: 8bit
9c6c51
9c6c51
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
9c6c51
(cherry picked from commit bfa2bd7e38f2777260b63200ef12804e13a7a5c2)
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1647822
9c6c51
9c6c51
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
9c6c51
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9c6c51
---
9c6c51
 docs/formatdomain.html.in                     | 12 ++++++++++++
9c6c51
 docs/schemas/domaincommon.rng                 |  5 +++++
9c6c51
 src/conf/domain_conf.c                        |  4 ++++
9c6c51
 src/conf/domain_conf.h                        |  1 +
9c6c51
 src/qemu/qemu_domain.c                        |  1 +
9c6c51
 tests/qemuxml2argvdata/pseries-features.xml   |  1 +
9c6c51
 tests/qemuxml2xmloutdata/pseries-features.xml |  1 +
9c6c51
 7 files changed, 25 insertions(+)
9c6c51
9c6c51
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
9c6c51
index 54eb298414..02d0ac4241 100644
9c6c51
--- a/docs/formatdomain.html.in
9c6c51
+++ b/docs/formatdomain.html.in
9c6c51
@@ -2191,6 +2191,18 @@
9c6c51
           defined, the hypervisor default will be used.
9c6c51
           Since 4.6.0 (QEMU/KVM only)
9c6c51
       
9c6c51
+      
nested-hv
9c6c51
+      
Configure nested HV availability for pSeries guests. This needs to
9c6c51
+          be enabled from the host (L0) in order to be effective; having HV
9c6c51
+          support in the (L1) guest is very desiderable if it's planned to
9c6c51
+          run nested (L2) guests inside it, because it will result in those
9c6c51
+          nested guests having much better performance than they would when
9c6c51
+          using KVM PR or TCG.
9c6c51
+          Possible values for the state attribute are
9c6c51
+          on and off. If the attribute is not
9c6c51
+          defined, the hypervisor default will be used.
9c6c51
+          Since 4.10.0 (QEMU/KVM only)
9c6c51
+      
9c6c51
     
9c6c51
 
9c6c51
     

Time keeping

9c6c51
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
9c6c51
index e4ce7804b9..70a7767d9c 100644
9c6c51
--- a/docs/schemas/domaincommon.rng
9c6c51
+++ b/docs/schemas/domaincommon.rng
9c6c51
@@ -4925,6 +4925,11 @@
9c6c51
               <ref name="featurestate"/>
9c6c51
             </element>
9c6c51
           </optional>
9c6c51
+          <optional>
9c6c51
+            <element name="nested-hv">
9c6c51
+              <ref name="featurestate"/>
9c6c51
+            </element>
9c6c51
+          </optional>
9c6c51
         </interleave>
9c6c51
       </element>
9c6c51
     </optional>
9c6c51
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
9c6c51
index e013e9f0c5..660e1523fe 100644
9c6c51
--- a/src/conf/domain_conf.c
9c6c51
+++ b/src/conf/domain_conf.c
9c6c51
@@ -153,6 +153,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST,
9c6c51
               "hpt",
9c6c51
               "vmcoreinfo",
9c6c51
               "htm",
9c6c51
+              "nested-hv",
9c6c51
 );
9c6c51
 
9c6c51
 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_LAST,
9c6c51
@@ -19987,6 +19988,7 @@ virDomainDefParseXML(xmlDocPtr xml,
9c6c51
             break;
9c6c51
 
9c6c51
         case VIR_DOMAIN_FEATURE_HTM:
9c6c51
+        case VIR_DOMAIN_FEATURE_NESTED_HV:
9c6c51
             if (!(tmp = virXMLPropString(nodes[i], "state"))) {
9c6c51
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9c6c51
                                _("missing state attribute '%s' of feature '%s'"),
9c6c51
@@ -22147,6 +22149,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src,
9c6c51
         case VIR_DOMAIN_FEATURE_SMM:
9c6c51
         case VIR_DOMAIN_FEATURE_VMCOREINFO:
9c6c51
         case VIR_DOMAIN_FEATURE_HTM:
9c6c51
+        case VIR_DOMAIN_FEATURE_NESTED_HV:
9c6c51
             if (src->features[i] != dst->features[i]) {
9c6c51
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9c6c51
                                _("State of feature '%s' differs: "
9c6c51
@@ -27823,6 +27826,7 @@ virDomainDefFormatInternal(virDomainDefPtr def,
9c6c51
             case VIR_DOMAIN_FEATURE_PVSPINLOCK:
9c6c51
             case VIR_DOMAIN_FEATURE_VMPORT:
9c6c51
             case VIR_DOMAIN_FEATURE_HTM:
9c6c51
+            case VIR_DOMAIN_FEATURE_NESTED_HV:
9c6c51
                 switch ((virTristateSwitch) def->features[i]) {
9c6c51
                 case VIR_TRISTATE_SWITCH_LAST:
9c6c51
                 case VIR_TRISTATE_SWITCH_ABSENT:
9c6c51
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
9c6c51
index d32514e7e6..f05fca284f 100644
9c6c51
--- a/src/conf/domain_conf.h
9c6c51
+++ b/src/conf/domain_conf.h
9c6c51
@@ -1775,6 +1775,7 @@ typedef enum {
9c6c51
     VIR_DOMAIN_FEATURE_HPT,
9c6c51
     VIR_DOMAIN_FEATURE_VMCOREINFO,
9c6c51
     VIR_DOMAIN_FEATURE_HTM,
9c6c51
+    VIR_DOMAIN_FEATURE_NESTED_HV,
9c6c51
 
9c6c51
     VIR_DOMAIN_FEATURE_LAST
9c6c51
 } virDomainFeature;
9c6c51
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
9c6c51
index 4fcca1e05a..0ddc6ef4a7 100644
9c6c51
--- a/src/qemu/qemu_domain.c
9c6c51
+++ b/src/qemu/qemu_domain.c
9c6c51
@@ -3819,6 +3819,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def,
9c6c51
 
9c6c51
         case VIR_DOMAIN_FEATURE_HPT:
9c6c51
         case VIR_DOMAIN_FEATURE_HTM:
9c6c51
+        case VIR_DOMAIN_FEATURE_NESTED_HV:
9c6c51
             if (def->features[i] != VIR_TRISTATE_SWITCH_ABSENT &&
9c6c51
                 !qemuDomainIsPSeries(def)) {
9c6c51
                 virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
9c6c51
diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2argvdata/pseries-features.xml
9c6c51
index 5c842fe87b..6f7d32b065 100644
9c6c51
--- a/tests/qemuxml2argvdata/pseries-features.xml
9c6c51
+++ b/tests/qemuxml2argvdata/pseries-features.xml
9c6c51
@@ -11,6 +11,7 @@
9c6c51
       <maxpagesize unit='GiB'>1</maxpagesize>
9c6c51
     </hpt>
9c6c51
     <htm state='on'/>
9c6c51
+    <nested-hv state='off'/>
9c6c51
   </features>
9c6c51
   <devices>
9c6c51
     <emulator>/usr/bin/qemu-system-ppc64</emulator>
9c6c51
diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2xmloutdata/pseries-features.xml
9c6c51
index 55a44c75a0..7e12bc9c03 100644
9c6c51
--- a/tests/qemuxml2xmloutdata/pseries-features.xml
9c6c51
+++ b/tests/qemuxml2xmloutdata/pseries-features.xml
9c6c51
@@ -13,6 +13,7 @@
9c6c51
       <maxpagesize unit='KiB'>1048576</maxpagesize>
9c6c51
     </hpt>
9c6c51
     <htm state='on'/>
9c6c51
+    <nested-hv state='off'/>
9c6c51
   </features>
9c6c51
   <clock offset='utc'/>
9c6c51
   <on_poweroff>destroy</on_poweroff>
9c6c51
-- 
9c6c51
2.20.1
9c6c51