virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-11-25 19:57:49 +01:00
parent 6e83fafe33
commit 5050b71da0
4 changed files with 6 additions and 5 deletions

View 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)

View File

@ -10,7 +10,7 @@
</os>
<features>
<acpi/>
<hyperv>
<hyperv mode='custom'>
<relaxed state='off'/>
<vapic state='off'/>
<spinlocks state='off'/>

View File

@ -10,7 +10,7 @@
</os>
<features>
<acpi/>
<hyperv>
<hyperv mode='custom'>
<vpindex state='on'/>
<synic state='on'/>
<stimer state='on'>

View File

@ -10,7 +10,7 @@
</os>
<features>
<acpi/>
<hyperv>
<hyperv mode='custom'>
<relaxed state='on'/>
<vapic state='on'/>
<spinlocks state='on' retries='12287'/>