]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
storage: Format mount options before positional arguments
authorPeter Krempa <pkrempa@redhat.com>
Tue, 6 Apr 2021 14:40:42 +0000 (16:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 12 Apr 2021 13:55:10 +0000 (15:55 +0200)
Move calls to virStorageBackendFileSystemMountAddOptions earlier so that
the options are formatted before the positional arguments.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
19 files changed:
src/storage/storage_util.c
tests/storagepoolxml2argvdata/pool-fs-freebsd.argv
tests/storagepoolxml2argvdata/pool-fs-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-cifs.argv
tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-gluster.argv
tests/storagepoolxml2argvdata/pool-netfs-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv
tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv
tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv
tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv

index 687bc645ee7c9a44aec5c748a332fddd99a95b4f..6cf6753ef3b69c943abe0d0632c398282c63033d 100644 (file)
@@ -4140,8 +4140,8 @@ virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd,
                                         virStoragePoolDefPtr def,
                                         const char *nfsVers)
 {
-    virCommandAddArgList(cmd, src, def->target.path, NULL);
     virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
+    virCommandAddArgList(cmd, src, def->target.path, NULL);
 }
 
 
@@ -4153,8 +4153,8 @@ virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd,
     const char *fmt;
 
     fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
-    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
     virStorageBackendFileSystemMountAddOptions(cmd, def, "direct-io-mode=1");
+    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
 }
 
 
@@ -4166,8 +4166,8 @@ virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd,
     const char *fmt;
 
     fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
-    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
     virStorageBackendFileSystemMountAddOptions(cmd, def, "guest");
+    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
 }
 
 
@@ -4183,8 +4183,8 @@ virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd,
         fmt = virStoragePoolFormatFileSystemTypeToString(def->source.format);
     else
         fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
-    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
     virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
+    virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
 }
 
 
index a35d73e2544fbfe843d4bd869cd88d4c129a8fd6..19dac7599e505754edf59332c77e974a9a27ec43 100644 (file)
@@ -1 +1,5 @@
-mount -t ext3 /dev/sda6 /mnt -o nosuid,noexec
+mount \
+-o nosuid,noexec \
+-t ext3 \
+/dev/sda6 \
+/mnt
index 19543f442d8ba9843002178a08627f016f9f7857..6d014320cf4683e712d6a8536fafd1b58d79e547 100644 (file)
@@ -1 +1,3 @@
-mount -t ext3 /dev/sda6 /mnt -o nodev,nosuid,noexec
+mount \
+-o nodev,nosuid,noexec \
+-t ext3 /dev/sda6 /mnt
index 39e5c97aedd98233989905c5d6344281e3a77522..8ef4527680d0fe74c9fea9ccf5dfd11627049639 100644 (file)
@@ -1 +1,4 @@
-mount localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec
+mount \
+-o nosuid,noexec \
+localhost:/var/lib/libvirt/images \
+/mnt
index 1f82d3d29cc5365a8ea428cf85ead11207278a52..b5e455090a27b21e6d45a4ce993e4ea1cac250bc 100644 (file)
@@ -1 +1,2 @@
-mount localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec
+mount \
+-o nodev,nosuid,noexec localhost:/var/lib/libvirt/images /mnt
index d72749a0320a7eb93530cbee3ca2187f1741bd28..fe4b4dbe35a1eae4de4d4595b2a7ed8b6ca07a1e 100644 (file)
@@ -1 +1,5 @@
-mount -t cifs //example.com/samba_share /mnt/cifs -o nosuid,noexec,guest
+mount \
+-o nosuid,noexec,guest \
+-t cifs \
+//example.com/samba_share \
+/mnt/cifs
index 85aa9cf23f141d057dd393a0e286744bf61dfeac..feb20d7bc8a5c4b89d5fd89a62b84a08a904f887 100644 (file)
@@ -1 +1,3 @@
-mount -t cifs //example.com/samba_share /mnt/cifs -o nodev,nosuid,noexec,guest
+mount \
+-o nodev,nosuid,noexec,guest \
+-t cifs //example.com/samba_share /mnt/cifs
index 2fef6f5782b5dea8921c145c55954fbd85076ff8..1e9eeb467b959297d7545c823501e40a78f9ca4a 100644 (file)
@@ -1 +1,5 @@
-mount -t cifs //example.com/samba_share /mnt/cifs -o guest
+mount \
+-o guest \
+-t cifs \
+//example.com/samba_share \
+/mnt/cifs
index 05c1951f32e91a97f3b0208c670a574804ae4829..15efc9453123bfb0adb8e6801cae9f2e8eb9f545 100644 (file)
@@ -1 +1,5 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec
+mount \
+-o nosuid,noexec \
+-t nfs \
+localhost:/var/lib/libvirt/images \
+/mnt
index 700107d78eb43ebd4cd52caf1fdd9ee23ca44bd4..38dfabdaab6eefdf1789321af612556008841cdb 100644 (file)
@@ -1,2 +1,5 @@
-mount -t glusterfs example.com:/volume /mnt/gluster -o nosuid,noexec,\
-direct-io-mode=1
+mount \
+-o nosuid,noexec,direct-io-mode=1 \
+-t glusterfs \
+example.com:/volume \
+/mnt/gluster
index 9535c8a1b9c14db7c163954581c42b369f511cf1..4524bc921aaf088b6a3d16c2e1332694398262f1 100644 (file)
@@ -1,2 +1,3 @@
-mount -t glusterfs example.com:/volume /mnt/gluster -o nodev,nosuid,noexec,\
-direct-io-mode=1
+mount \
+-o nodev,nosuid,noexec,direct-io-mode=1 \
+-t glusterfs example.com:/volume /mnt/gluster
index 97be9cbeb309166e90ff2923279d3a7e6b803981..ec9a09defe3db487fdce35df23250612a563f147 100644 (file)
@@ -1 +1,5 @@
-mount -t glusterfs example.com:/volume /mnt/gluster -o direct-io-mode=1
+mount \
+-o direct-io-mode=1 \
+-t glusterfs \
+example.com:/volume \
+/mnt/gluster
index 22fafd7b32e1df5df28bee116b6f57b8438a2351..ce0d88cfacecced739fbbef7eae992530b21c3c7 100644 (file)
@@ -1 +1,3 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec
+mount \
+-o nodev,nosuid,noexec \
+-t nfs localhost:/var/lib/libvirt/images /mnt
index ac5c0acd00c135df74597ae0213de7aa9c81e2a0..b90811e0fdfc8be2e770209beda44fce16aef36b 100644 (file)
@@ -1,2 +1,5 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec,nfsvers=3,\
-sync,lazytime
+mount \
+-o nosuid,noexec,nfsvers=3,sync,lazytime \
+-t nfs \
+localhost:/var/lib/libvirt/images \
+/mnt
index 8e10379c0493279629e8d8cb9a91c53f4b5af48d..517fdbb0803c705ecc9f6fa97f9b2780da077e65 100644 (file)
@@ -1,2 +1,3 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec,\
-nfsvers=3,sync,lazytime
+mount \
+-o nodev,nosuid,noexec,nfsvers=3,sync,lazytime \
+-t nfs localhost:/var/lib/libvirt/images /mnt
index a63d6da456f06a8af583688feb87bc074fa80f71..0d6d62793dfadabf152e02a54084506ad12d20f0 100644 (file)
@@ -1 +1,5 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nfsvers=3,sync,lazytime
+mount \
+-o nfsvers=3,sync,lazytime \
+-t nfs \
+localhost:/var/lib/libvirt/images \
+/mnt
index 59d09d2e5d51e1a94054ee16704f6c80ecb99d43..32cdaebcffd21af91aecc02c6b1511fedf8e69da 100644 (file)
@@ -1 +1,5 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec,nfsvers=3
+mount \
+-o nosuid,noexec,nfsvers=3 \
+-t nfs \
+localhost:/var/lib/libvirt/images \
+/mnt
index c819a089d205190e5e088cb31c77cb2b970364df..fc1d91c614f92a649c8587aa6955c883770a4f93 100644 (file)
@@ -1,2 +1,3 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec,\
-nfsvers=3
+mount \
+-o nodev,nosuid,noexec,nfsvers=3 \
+-t nfs localhost:/var/lib/libvirt/images /mnt
index f26656d5b83bda38e1cf5a80d82922631987ddcf..ed157883c05e3f3a40eaa6a5e113f7a2aa44d16a 100644 (file)
@@ -1 +1,5 @@
-mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nfsvers=3
+mount \
+-o nfsvers=3 \
+-t nfs \
+localhost:/var/lib/libvirt/images \
+/mnt