]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: fs: allow missing accessmode in the formatter
authorJán Tomko <jtomko@redhat.com>
Mon, 7 Sep 2020 15:12:56 +0000 (17:12 +0200)
committerJán Tomko <jtomko@redhat.com>
Wed, 21 Apr 2021 13:48:01 +0000 (15:48 +0200)
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@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c

index 508d4bfc326974852076aaa697cc3f81a426d3dd..a9ed74f33ee167f6fa8cbe3247e4acc2dd276a37 100644 (file)
@@ -25265,9 +25265,9 @@ virDomainFSDefFormat(virBuffer *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));