render / rpms / libvirt

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

Time keeping

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