[PATCH 2/3] storage: Add mountOpts to the storage pool mount command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the mountOpts to the generated backend mount command line for
the storage pool.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/storage/storage_util.c                              | 4 ++++
 tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv | 1 +
 tests/storagepoolxml2argvtest.c                         | 1 +
 3 files changed, 6 insertions(+)
 create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv

diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
index a84ee5b600..6d7c01e425 100644
--- a/src/storage/storage_util.c
+++ b/src/storage/storage_util.c
@@ -4336,6 +4336,10 @@ virStorageBackendFileSystemMountCmd(const char *cmdstr,
         virStorageBackendFileSystemMountCIFSArgs(cmd, src, def);
     else
         virStorageBackendFileSystemMountDefaultArgs(cmd, src, def);
+
+    if (def->source.mountOpts)
+        virCommandAddArgList(cmd, "-o", def->source.mountOpts, NULL);
+
     return cmd;
 }
 
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv b/tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv
new file mode 100644
index 0000000000..16d35bc175
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-mountopts.argv
@@ -0,0 +1 @@
+mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nodev,nosuid
diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
index 2f2d40e027..0df97fb390 100644
--- a/tests/storagepoolxml2argvtest.c
+++ b/tests/storagepoolxml2argvtest.c
@@ -159,6 +159,7 @@ mymain(void)
     DO_TEST("pool-netfs-auto");
     DO_TEST("pool-netfs-gluster");
     DO_TEST("pool-netfs-cifs");
+    DO_TEST("pool-netfs-mountopts");
     DO_TEST_FAIL("pool-scsi");
     DO_TEST_FAIL("pool-scsi-type-scsi-host");
     DO_TEST_FAIL("pool-scsi-type-fc-host");
-- 
2.17.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux