]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_capabilities: Report Hyper-V Enlightenments in domcapabilities
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 21 Dec 2022 15:09:29 +0000 (16:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 5 Jan 2023 11:35:42 +0000 (12:35 +0100)
Inside of qemuCaps (for the corresponding accelerator) we have
full host CPU expansion stored, among with supported Hyper-V
Enlightenments. To report them in the domain capabilities, we
just have to pick those starting with "hv-" and see if we know
them.

You may notice that neither of our domaincapsdata test shows any
enlightenment. This is because the test works by parsing
corresponding qemucapabilitiesdata/caps_*.xml file and none of
these store the full host CPU expansion (hostCPU.fullQEMU)
because that is runtime piece of information and not formatted
into virQEMUCaps XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1717611
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_capabilities.c
tests/domaincapsdata/qemu_8.0.0-q35.x86_64.xml
tests/domaincapsdata/qemu_8.0.0-tcg.x86_64.xml
tests/domaincapsdata/qemu_8.0.0.x86_64.xml

index c23adea289c5650ff437e1ff2fb29a44d72067af..1c120ff16346345c9362088537ff684e653d3d8d 100644 (file)
@@ -6823,6 +6823,16 @@ virQEMUCapsFillDomainFeatureSGXCaps(virQEMUCaps *qemuCaps,
     virQEMUCapsSGXInfoCopy(&domCaps->sgx, qemuCaps->sgxCapabilities);
 }
 
+
+static void
+virQEMUCapsFillDomainFeatureHypervCaps(virQEMUCaps *qemuCaps,
+                                       virDomainCaps *domCaps)
+{
+    domCaps->hyperv = g_memdup(qemuCaps->hypervCapabilities,
+                               sizeof(virDomainCapsFeatureHyperv));
+}
+
+
 int
 virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
                           virArch hostarch,
@@ -6879,6 +6889,7 @@ virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps,
     virQEMUCapsFillDomainFeatureSEVCaps(qemuCaps, domCaps);
     virQEMUCapsFillDomainFeatureS390PVCaps(qemuCaps, domCaps);
     virQEMUCapsFillDomainFeatureSGXCaps(qemuCaps, domCaps);
+    virQEMUCapsFillDomainFeatureHypervCaps(qemuCaps, domCaps);
 
     return 0;
 }
index efc67b2ef94b7e9a2563125b82ef7ccaaeea6fb9..4170ae7a974f71f8fa9c1b7d6bbd00d18a6808d5 100644 (file)
     <backup supported='yes'/>
     <sev supported='no'/>
     <sgx supported='no'/>
+    <hyperv supported='yes'>
+      <enum name='features'>
+        <value>relaxed</value>
+        <value>vapic</value>
+        <value>spinlocks</value>
+        <value>vpindex</value>
+        <value>runtime</value>
+        <value>synic</value>
+        <value>stimer</value>
+        <value>reset</value>
+        <value>vendor_id</value>
+        <value>frequencies</value>
+        <value>reenlightenment</value>
+        <value>tlbflush</value>
+        <value>ipi</value>
+        <value>avic</value>
+      </enum>
+    </hyperv>
   </features>
 </domainCapabilities>
index d9b092e6fdb9b53094f4481068fbdb0dc5cdcd81..3b52eba64f8de61da5c75764cbe3a8a18742c3b6 100644 (file)
     <backup supported='yes'/>
     <sev supported='no'/>
     <sgx supported='no'/>
+    <hyperv supported='yes'>
+      <enum name='features'>
+        <value>relaxed</value>
+        <value>vapic</value>
+        <value>spinlocks</value>
+        <value>vpindex</value>
+        <value>runtime</value>
+        <value>synic</value>
+        <value>stimer</value>
+        <value>reset</value>
+        <value>vendor_id</value>
+        <value>frequencies</value>
+        <value>reenlightenment</value>
+        <value>tlbflush</value>
+        <value>ipi</value>
+        <value>avic</value>
+      </enum>
+    </hyperv>
   </features>
 </domainCapabilities>
index 2b17a409bd7a5f811ead94558ccb06a10494ff9f..fac8033f7634d118d9c295be6a67052f5e05396b 100644 (file)
     <backup supported='yes'/>
     <sev supported='no'/>
     <sgx supported='no'/>
+    <hyperv supported='yes'>
+      <enum name='features'>
+        <value>relaxed</value>
+        <value>vapic</value>
+        <value>spinlocks</value>
+        <value>vpindex</value>
+        <value>runtime</value>
+        <value>synic</value>
+        <value>stimer</value>
+        <value>reset</value>
+        <value>vendor_id</value>
+        <value>frequencies</value>
+        <value>reenlightenment</value>
+        <value>tlbflush</value>
+        <value>ipi</value>
+        <value>avic</value>
+      </enum>
+    </hyperv>
   </features>
 </domainCapabilities>