[libvirt] [PATCH] Domain config: write <features/> if some capabilities are set.

Cédric Bosdonnat cbosdonnat at suse.com
Wed Jul 30 09:25:47 UTC 2014


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




More information about the libvir-list mailing list