From 5050b71da03fa644895299681835131d212f5516 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Thu, 25 Nov 2021 19:57:49 +0100 Subject: [PATCH] virDomainDefFormatFeatures: Write attribute "mode" of element "hyperv" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko --- src/conf/domain_conf.c | 5 +++-- tests/qemuxml2xmloutdata/hyperv-off.xml | 2 +- tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml | 2 +- tests/qemuxml2xmloutdata/hyperv.xml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1a5afbfa41..0ae28a0a7c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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, "\n"); + virBufferAsprintf(&childBuf, "\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) diff --git a/tests/qemuxml2xmloutdata/hyperv-off.xml b/tests/qemuxml2xmloutdata/hyperv-off.xml index 20c7f653af..94288e2516 100644 --- a/tests/qemuxml2xmloutdata/hyperv-off.xml +++ b/tests/qemuxml2xmloutdata/hyperv-off.xml @@ -10,7 +10,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml b/tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml index d49eb75b12..3710191d75 100644 --- a/tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml +++ b/tests/qemuxml2xmloutdata/hyperv-stimer-direct.xml @@ -10,7 +10,7 @@ - + diff --git a/tests/qemuxml2xmloutdata/hyperv.xml b/tests/qemuxml2xmloutdata/hyperv.xml index 00af005671..87f09257c7 100644 --- a/tests/qemuxml2xmloutdata/hyperv.xml +++ b/tests/qemuxml2xmloutdata/hyperv.xml @@ -10,7 +10,7 @@ - +