[libvirt PATCHv1 2/4] conf: fs: allow missing accessmode in the formatter

Ján Tomko jtomko at redhat.com
Wed Mar 31 18:55:36 UTC 2021


So far VIR_DOMAIN_FS_ACCESSMODE_PASSTHROUGH is always set
in virDomainFSDefPostParse, but future commits aim to change
that.

Signed-off-by: Ján Tomko <jtomko at redhat.com>
---
 src/conf/domain_conf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 3c3e381de2..5a1e193b2d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -25436,9 +25436,9 @@ virDomainFSDefFormat(virBufferPtr buf,
         return -1;
     }
 
-    virBufferAsprintf(buf,
-                      "<filesystem type='%s' accessmode='%s'",
-                      type, accessmode);
+    virBufferAsprintf(buf, "<filesystem type='%s'", type);
+    if (def->accessmode != VIR_DOMAIN_FS_ACCESSMODE_DEFAULT)
+        virBufferAsprintf(buf, " accessmode='%s'", accessmode);
     if (def->model) {
         virBufferAsprintf(buf, " model='%s'",
                           virDomainFSModelTypeToString(def->model));
-- 
2.29.2




More information about the libvir-list mailing list