static void
virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd,
+ virStoragePoolDefPtr def,
const char *providedOpts)
{
VIR_AUTOFREE(char *) mountOpts = NULL;
if (providedOpts)
virBufferAsprintf(&buf, "%s,", providedOpts);
+ if (def->namespaceData) {
+ size_t i;
+ virStoragePoolFSMountOptionsDefPtr opts = def->namespaceData;
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ for (i = 0; i < opts->noptions; i++)
+ virBufferAsprintf(&buf, "%s,", opts->options[i]);
+
+ virUUIDFormat(def->uuid, uuidstr);
+ VIR_WARN("Storage Pool name='%s' uuid='%s' is tainted by custom "
+ "mount_opts from XML", def->name, uuidstr);
+ }
+
virBufferTrim(&buf, ",", -1);
mountOpts = virBufferContentAndReset(&buf);
const char *nfsVers)
{
virCommandAddArgList(cmd, src, def->target.path, NULL);
- virStorageBackendFileSystemMountAddOptions(cmd, nfsVers);
+ virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
}
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
- virStorageBackendFileSystemMountAddOptions(cmd, "direct-io-mode=1");
+ virStorageBackendFileSystemMountAddOptions(cmd, def, "direct-io-mode=1");
}
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
- virStorageBackendFileSystemMountAddOptions(cmd, "guest");
+ virStorageBackendFileSystemMountAddOptions(cmd, def, "guest");
}
else
fmt = virStoragePoolFormatFileSystemNetTypeToString(def->source.format);
virCommandAddArgList(cmd, "-t", fmt, src, def->target.path, NULL);
- virStorageBackendFileSystemMountAddOptions(cmd, nfsVers);
+ virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers);
}
#define DO_TEST_FREEBSD(pool, ...) \
DO_TEST_FULL(false, pool, false, true)
+ if (storageRegisterAll() < 0)
+ return EXIT_FAILURE;
+
DO_TEST_FAIL("pool-dir");
DO_TEST_FAIL("pool-dir-naming");
DO_TEST("pool-logical");
DO_TEST_LINUX("pool-netfs");
DO_TEST_LINUX("pool-netfs-auto");
DO_TEST_LINUX("pool-netfs-protocol-ver");
+ DO_TEST_LINUX("pool-netfs-ns-mountopts");
DO_TEST_LINUX("pool-netfs-gluster");
DO_TEST_LINUX("pool-netfs-cifs");
#elif defined(__FreeBSD__)
DO_TEST_FREEBSD("pool-netfs");
DO_TEST_FREEBSD("pool-netfs-auto");
DO_TEST_FREEBSD("pool-netfs-protocol-ver");
+ DO_TEST_FREEBSD("pool-netfs-ns-mountopts");
DO_TEST_FREEBSD("pool-netfs-gluster");
DO_TEST_FREEBSD("pool-netfs-cifs");
#else
DO_TEST("pool-netfs");
DO_TEST("pool-netfs-auto");
DO_TEST("pool-netfs-protocol-ver");
+ DO_TEST("pool-netfs-ns-mountopts");
DO_TEST("pool-netfs-gluster");
DO_TEST("pool-netfs-cifs");
#endif