]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"
authorTim Wiederhake <twiederh@redhat.com>
Thu, 25 Nov 2021 18:57:49 +0000 (19:57 +0100)
committerTim Wiederhake <twiederh@redhat.com>
Tue, 14 Dec 2021 15:50:45 +0000 (16:50 +0100)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/domain_conf.c
tests/qemuxml2xmloutdata/hyperv-off.xml
tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml
tests/qemuxml2xmloutdata/hyperv.xml

index 1a5afbfa41025a80382e850278412b8609cf367a..0ae28a0a7c9fffa33da0ba8b88ffdf0554eab1a3 100644 (file)
@@ -27839,10 +27839,11 @@ virDomainDefFormatFeatures(virBuffer *buf,
             break;
 
         case VIR_DOMAIN_FEATURE_HYPERV:
-            if (def->features[i] != VIR_TRISTATE_SWITCH_ON)
+            if (def->features[i] == VIR_DOMAIN_HYPERV_MODE_NONE)
                 break;
 
-            virBufferAddLit(&childBuf, "<hyperv>\n");
+            virBufferAsprintf(&childBuf, "<hyperv mode='%s'>\n",
+                              virDomainHyperVModeTypeToString(def->features[i]));
             virBufferAdjustIndent(&childBuf, 2);
             for (j = 0; j < VIR_DOMAIN_HYPERV_LAST; j++) {
                 if (def->hyperv_features[j] == VIR_TRISTATE_SWITCH_ABSENT)
index 20c7f653af8e9cd708c02117233622dfbeeeb437..94288e2516fce95ca41d89fb5cf8bf0d3a07b8ec 100644 (file)
@@ -10,7 +10,7 @@
   </os>
   <features>
     <acpi/>
-    <hyperv>
+    <hyperv mode='custom'>
       <relaxed state='off'/>
       <vapic state='off'/>
       <spinlocks state='off'/>
index d49eb75b12a67ff57fa991525fad9404e07d2b6d..3710191d75acf303db62cf6f1074dfa96f55d0ce 100644 (file)
@@ -10,7 +10,7 @@
   </os>
   <features>
     <acpi/>
-    <hyperv>
+    <hyperv mode='custom'>
       <vpindex state='on'/>
       <synic state='on'/>
       <stimer state='on'>
index 00af005671cbdcda8eef9039372db411f430a060..87f09257c7372ce99912f5523d0226cc3950701d 100644 (file)
@@ -10,7 +10,7 @@
   </os>
   <features>
     <acpi/>
-    <hyperv>
+    <hyperv mode='custom'>
       <relaxed state='on'/>
       <vapic state='on'/>
       <spinlocks state='on' retries='12287'/>