static int
virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) {
char *src;
- char *options = NULL;
const char **mntargv;
/* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
int glusterfs = (pool->def->type == VIR_STORAGE_POOL_NETFS &&
pool->def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS);
- int option_index;
int source_index;
const char *netfs_auto_argv[] = {
virStoragePoolFormatFileSystemNetTypeToString(pool->def->source.format),
NULL,
"-o",
- NULL,
+ "direct-io-mode=1",
pool->def->target.path,
NULL,
};
} else if (glusterfs) {
mntargv = glusterfs_argv;
source_index = 3;
- option_index = 5;
} else {
mntargv = fs_argv;
source_index = 3;
}
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
- if (pool->def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS) {
- if ((options = strdup("direct-io-mode=1")) == NULL) {
- virReportOOMError();
- return -1;
- }
- }
if (virAsprintf(&src, "%s:%s",
pool->def->source.host.name,
pool->def->source.dir) == -1) {
}
mntargv[source_index] = src;
- if (glusterfs) {
- mntargv[option_index] = options;
- }
-
if (virRun(mntargv, NULL) < 0) {
VIR_FREE(src);
return -1;