[PATCH v1 6/7] domain_capabilities: Expose Hyper-V Enlightenments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 docs/formatdomaincaps.rst       | 15 +++++++++++++++
 src/conf/domain_capabilities.c  | 12 ++++++++++++
 src/conf/domain_capabilities.h  |  8 ++++++++
 src/conf/schemas/domaincaps.rng | 10 ++++++++++
 4 files changed, 45 insertions(+)

diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst
index 532fea0f60..dc227e9d02 100644
--- a/docs/formatdomaincaps.rst
+++ b/docs/formatdomaincaps.rst
@@ -624,6 +624,12 @@ capabilities. All features occur as children of the main ``features`` element.
            <section node='1' size='262144' unit='KiB'/>
          </sections>
        </sgx>
+       <hyperv supported='yes'>
+         <enum name='features'>
+           <value>relaxed</value>
+           <value>vapic</value>
+         </enum>
+       </hyperv>
      </features>
    </domainCapabilities>
 
@@ -733,3 +739,12 @@ document store. In order to use SGX with libvirt have a look at `SGX in domain X
 
 ``sections``
    The sections of the SGX enclave page cache (called EPC).
+
+
+Hyper-V Enlightenments
+^^^^^^^^^^^^^^^^^^^^^^
+
+Report which features improving behavior of guests running Microsoft Windows
+are supported. The ``features`` enum corresponds to the ``<hyperv/>`` element
+(well, its children) as documented in `Hypervisor features
+<formatdomain.html#hypervisor-features>`__
diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c
index 4e412c0fd8..88bb8e2872 100644
--- a/src/conf/domain_capabilities.c
+++ b/src/conf/domain_capabilities.c
@@ -684,6 +684,17 @@ virDomainCapsFeatureSGXFormat(virBuffer *buf,
     virBufferAddLit(buf, "</sgx>\n");
 }
 
+static void
+virDomainCapsFeatureHypervFormat(virBuffer *buf,
+                                 const virDomainCapsFeatureHyperv *hyperv)
+{
+    FORMAT_PROLOGUE(hyperv);
+
+    ENUM_PROCESS(hyperv, features, virDomainHypervTypeToString);
+
+    FORMAT_EPILOGUE(hyperv);
+}
+
 static void
 virDomainCapsFormatFeatures(const virDomainCaps *caps,
                             virBuffer *buf)
@@ -704,6 +715,7 @@ virDomainCapsFormatFeatures(const virDomainCaps *caps,
 
     virDomainCapsFeatureSEVFormat(&childBuf, caps->sev);
     virDomainCapsFeatureSGXFormat(&childBuf, caps->sgx);
+    virDomainCapsFeatureHypervFormat(&childBuf, &caps->hyperv);
 
     virXMLFormatElement(buf, "features", NULL, &childBuf);
 }
diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h
index 1d504a3506..5ed29c7444 100644
--- a/src/conf/domain_capabilities.h
+++ b/src/conf/domain_capabilities.h
@@ -158,6 +158,13 @@ struct _virDomainCapsFeatureGIC {
     virDomainCapsEnum version; /* Info about virGICVersion */
 };
 
+STATIC_ASSERT_ENUM(VIR_DOMAIN_HYPERV_LAST);
+typedef struct _virDomainCapsFeatureHyperv virDomainCapsFeatureHyperv;
+struct _virDomainCapsFeatureHyperv {
+    virTristateBool supported;
+    virDomainCapsEnum features; /* Info about supported virDomainHyperv features */
+};
+
 typedef enum {
     VIR_DOMCAPS_CPU_USABLE_UNKNOWN,
     VIR_DOMCAPS_CPU_USABLE_YES,
@@ -263,6 +270,7 @@ struct _virDomainCaps {
     virDomainCapsFeatureGIC gic;
     virSEVCapability *sev;
     virSGXCapability *sgx;
+    virDomainCapsFeatureHyperv hyperv;
     /* add new domain features here */
 
     virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST];
diff --git a/src/conf/schemas/domaincaps.rng b/src/conf/schemas/domaincaps.rng
index b6408bca88..4b96e89dfa 100644
--- a/src/conf/schemas/domaincaps.rng
+++ b/src/conf/schemas/domaincaps.rng
@@ -296,6 +296,9 @@
       <optional>
         <ref name="sgx"/>
       </optional>
+      <optional>
+        <ref name="hyperv"/>
+      </optional>
     </element>
   </define>
 
@@ -396,6 +399,13 @@
     </element>
   </define>
 
+  <define name="hyperv">
+    <element name="hyperv">
+      <ref name="supported"/>
+      <ref name="enum"/>
+    </element>
+  </define>
+
   <define name="value">
     <zeroOrMore>
       <element name="value">
-- 
2.38.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux