If all features are set to default (including the capabilities policy),
but some capabilities are toggled, we need to output the <features>
element when formatting the config.
---
src/conf/domain_conf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 2a8cdeb..421a44a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17860,7 +17860,8 @@ virDomainDefFormatInternal(virDomainDefPtr def,
break;
}
- if (i != VIR_DOMAIN_FEATURE_LAST) {
+ if (i != VIR_DOMAIN_FEATURE_LAST ||
+ virDomainDefHasCapabilitiesFeatures(def)) {
virBufferAddLit(buf, "<features>\n");
virBufferAdjustIndent(buf, 2);
--
1.8.4.5