diff --git a/docs/formatstorage.html.in b/docs/formatstorage.html.in index 17558f87be2aed6883baa2db96b5975466c5290a..b6f43613ee3dbcb9e03d771abc68052e86f37cb0 100644 --- a/docs/formatstorage.html.in +++ b/docs/formatstorage.html.in @@ -124,11 +124,14 @@ Since 0.4.1
dir
Provides the source for pools backed by directories (pool - type dir), or optionally to select a subdirectory + types dir, netfs, gluster), + or optionally to select a subdirectory within a pool that resembles a filesystem (pool type gluster). May only occur once. Contains a single attribute path - which is the fully qualified path to the backing directory. + which is the fully qualified path to the backing directory or + for a netfs pool type using format + type "cifs", the path to the Samba share without the leading slash. Since 0.4.1
adapter
Provides the source for pools backed by SCSI adapters (pool diff --git a/docs/storage.html.in b/docs/storage.html.in index 92e9ae7b59c62bbef8be37f6578e7f1c51480297..0b467d586d5885babea57e14330373f04fe43051 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in @@ -291,7 +291,8 @@ the gluster pool.)
  • - cifs - use the SMB (samba) or CIFS file system + cifs - use the SMB (samba) or CIFS file system. + The mount will use "-o guest" to mount the directory anonymously.
  • diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index d2cf470f48db98c8edf31c75d0c5718ab47043d4..b7516872916b1ef1eb62dafc032113aa37228c9e 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -426,6 +426,8 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) pool->def->source.format == VIR_STORAGE_POOL_NETFS_AUTO); bool glusterfs = (pool->def->type == VIR_STORAGE_POOL_NETFS && pool->def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS); + bool cifsfs = (pool->def->type == VIR_STORAGE_POOL_NETFS && + pool->def->source.format == VIR_STORAGE_POOL_NETFS_CIFS); virCommandPtr cmd = NULL; int ret = -1; int rc; @@ -444,11 +446,17 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) } if (pool->def->type == VIR_STORAGE_POOL_NETFS) { - if (virAsprintf(&src, "%s:%s", - pool->def->source.hosts[0].name, - pool->def->source.dir) == -1) - return -1; - + if (pool->def->source.format == VIR_STORAGE_POOL_NETFS_CIFS) { + if (virAsprintf(&src, "//%s/%s", + pool->def->source.hosts[0].name, + pool->def->source.dir) == -1) + return -1; + } else { + if (virAsprintf(&src, "%s:%s", + pool->def->source.hosts[0].name, + pool->def->source.dir) == -1) + return -1; + } } else { if (VIR_STRDUP(src, pool->def->source.devices[0].path) < 0) return -1; @@ -468,6 +476,15 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) "direct-io-mode=1", pool->def->target.path, NULL); + else if (cifsfs) + cmd = virCommandNewArgList(MOUNT, + "-t", + virStoragePoolFormatFileSystemNetTypeToString(pool->def->source.format), + src, + pool->def->target.path, + "-o", + "guest", + NULL); else cmd = virCommandNewArgList(MOUNT, "-t",