Move calls to virStorageBackendFileSystemMountAddOptions earlier so that the options are formatted before the positional arguments. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/storage/storage_util.c | 8 ++++---- tests/storagepoolxml2argvdata/pool-fs-freebsd.argv | 6 +++++- tests/storagepoolxml2argvdata/pool-fs-linux.argv | 4 +++- .../storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv | 5 ++++- tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv | 3 ++- .../storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv | 6 +++++- tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv | 4 +++- tests/storagepoolxml2argvdata/pool-netfs-cifs.argv | 6 +++++- tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv | 6 +++++- .../pool-netfs-gluster-freebsd.argv | 7 +++++-- .../storagepoolxml2argvdata/pool-netfs-gluster-linux.argv | 5 +++-- tests/storagepoolxml2argvdata/pool-netfs-gluster.argv | 6 +++++- tests/storagepoolxml2argvdata/pool-netfs-linux.argv | 4 +++- .../pool-netfs-ns-mountopts-freebsd.argv | 7 +++++-- .../pool-netfs-ns-mountopts-linux.argv | 5 +++-- .../storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv | 6 +++++- .../pool-netfs-protocol-ver-freebsd.argv | 6 +++++- .../pool-netfs-protocol-ver-linux.argv | 5 +++-- .../storagepoolxml2argvdata/pool-netfs-protocol-ver.argv | 6 +++++- 19 files changed, 78 insertions(+), 27 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 687bc645ee..6cf6753ef3 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -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); } diff --git a/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv index a35d73e254..19dac7599e 100644 --- a/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-fs-freebsd.argv @@ -1 +1,5 @@ -mount -t ext3 /dev/sda6 /mnt -o nosuid,noexec +mount \ +-o nosuid,noexec \ +-t ext3 \ +/dev/sda6 \ +/mnt diff --git a/tests/storagepoolxml2argvdata/pool-fs-linux.argv b/tests/storagepoolxml2argvdata/pool-fs-linux.argv index 19543f442d..6d014320cf 100644 --- a/tests/storagepoolxml2argvdata/pool-fs-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-fs-linux.argv @@ -1 +1,3 @@ -mount -t ext3 /dev/sda6 /mnt -o nodev,nosuid,noexec +mount \ +-o nodev,nosuid,noexec \ +-t ext3 /dev/sda6 /mnt diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv index 39e5c97aed..8ef4527680 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-auto-freebsd.argv @@ -1 +1,4 @@ -mount localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec +mount \ +-o nosuid,noexec \ +localhost:/var/lib/libvirt/images \ +/mnt diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv index 1f82d3d29c..b5e455090a 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-auto-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv index d72749a032..fe4b4dbe35 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs-freebsd.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv index 85aa9cf23f..feb20d7bc8 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv index 2fef6f5782..1e9eeb467b 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv index 05c1951f32..15efc94531 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-freebsd.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv index 700107d78e..38dfabdaab 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster-freebsd.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv index 9535c8a1b9..4524bc921a 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv index 97be9cbeb3..ec9a09defe 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-linux.argv index 22fafd7b32..ce0d88cfac 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-freebsd.argv index ac5c0acd00..b90811e0fd 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-freebsd.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-linux.argv index 8e10379c04..517fdbb080 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv index a63d6da456..0d6d62793d 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-ns-mountopts.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv index 59d09d2e5d..32cdaebcff 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-freebsd.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv index c819a089d2..fc1d91c614 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-linux.argv @@ -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 diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv index f26656d5b8..ed157883c0 100644 --- a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv +++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver.argv @@ -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 -- 2.30.2