+Thu Jul 17 17:18:24 CEST 2008 Daniel Veillard <veillard@redhat.com>
+
+ * src/storage_backend_fs.c: patch from Cole Robinson fixing
+ pool-create for netfs format 'auto'
+
Thu Jul 17 13:47:56 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/virsh.c: patch from Evgeniy Sokolov for the undefine command
virStorageBackendFileSystemMount(virConnectPtr conn,
virStoragePoolObjPtr pool) {
char *src;
- const char *mntargv[] = {
+ const char **mntargv;
+
+ /* 'mount -t auto' doesn't seem to auto determine nfs (or cifs),
+ * while plain 'mount' does. We have to craft separate argvs to
+ * accommodate this */
+ int netauto = (pool->def->type == VIR_STORAGE_POOL_NETFS &&
+ pool->def->source.format == VIR_STORAGE_POOL_NETFS_AUTO);
+ int source_index;
+
+ const char *netfs_auto_argv[] = {
+ MOUNT,
+ NULL, /* source path */
+ pool->def->target.path,
+ NULL,
+ };
+
+ const char *fs_argv[] = {
MOUNT,
"-t",
pool->def->type == VIR_STORAGE_POOL_FS ?
pool->def->source.format) :
virStorageBackendFileSystemNetPoolFormatToString(conn,
pool->def->source.format),
- NULL, /* Fill in shortly - careful not to add extra fields before this */
+ NULL, /* Fill in shortly - careful not to add extra fields
+ before this */
pool->def->target.path,
NULL,
};
+
+ if (netauto) {
+ mntargv = netfs_auto_argv;
+ source_index = 1;
+ } else {
+ mntargv = fs_argv;
+ source_index = 3;
+ }
+
int ret;
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
return -1;
}
}
- mntargv[3] = src;
+ mntargv[source_index] = src;
if (virRun(conn, (char**)mntargv, NULL) < 0) {
VIR_FREE(src);