storage: Format mount options before positional arguments

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>
This commit is contained in:
Peter Krempa 2021-04-06 16:40:42 +02:00
parent 0046e0b1c2
commit 06d7151664
19 changed files with 78 additions and 27 deletions

View File

@ -4140,8 +4140,8 @@ virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd,
virStoragePoolDefPtr def, virStoragePoolDefPtr def,
const char *nfsVers) const char *nfsVers)
{ {
virCommandAddArgList(cmd, src, def->target.path, NULL);
virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers); virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
virCommandAddArgList(cmd, src, def->target.path, NULL);
} }
@ -4153,8 +4153,8 @@ virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd,
const char *fmt; const char *fmt;
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format); fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
virStorageBackendFileSystemMountAddOptions(cmd, def, "direct-io-mode=1"); 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; const char *fmt;
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format); fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
virStorageBackendFileSystemMountAddOptions(cmd, def, "guest"); 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); fmt = virStoragePoolFormatFileSystemTypeToString(def->source.format);
else else
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format); fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers); virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
} }

View File

@ -1 +1,5 @@
mount -t ext3 /dev/sda6 /mnt -o nosuid,noexec mount \
-o nosuid,noexec \
-t ext3 \
/dev/sda6 \
/mnt

View File

@ -1 +1,3 @@
mount -t ext3 /dev/sda6 /mnt -o nodev,nosuid,noexec mount \
-o nodev,nosuid,noexec \
-t ext3 /dev/sda6 /mnt

View File

@ -1 +1,4 @@
mount localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec mount \
-o nosuid,noexec \
localhost:/var/lib/libvirt/images \
/mnt

View 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

View 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

View 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

View 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

View 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

View File

@ -1,2 +1,5 @@
mount -t glusterfs example.com:/volume /mnt/gluster -o nosuid,noexec,\ mount \
direct-io-mode=1 -o nosuid,noexec,direct-io-mode=1 \
-t glusterfs \
example.com:/volume \
/mnt/gluster

View File

@ -1,2 +1,3 @@
mount -t glusterfs example.com:/volume /mnt/gluster -o nodev,nosuid,noexec,\ mount \
direct-io-mode=1 -o nodev,nosuid,noexec,direct-io-mode=1 \
-t glusterfs example.com:/volume /mnt/gluster

View 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

View 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

View File

@ -1,2 +1,5 @@
mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nosuid,noexec,nfsvers=3,\ mount \
sync,lazytime -o nosuid,noexec,nfsvers=3,sync,lazytime \
-t nfs \
localhost:/var/lib/libvirt/images \
/mnt

View File

@ -1,2 +1,3 @@
mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec,\ mount \
nfsvers=3,sync,lazytime -o nodev,nosuid,noexec,nfsvers=3,sync,lazytime \
-t nfs localhost:/var/lib/libvirt/images /mnt

View 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

View 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

View File

@ -1,2 +1,3 @@
mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid,noexec,\ mount \
nfsvers=3 -o nodev,nosuid,noexec,nfsvers=3 \
-t nfs localhost:/var/lib/libvirt/images /mnt

View 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