mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
fix pool-create for netfs format 'auto'
* src/storage_backend_fs.c: patch from Cole Robinson fixing pool-create for netfs format 'auto' Daniel
This commit is contained in:
parent
16b8942966
commit
dfccabe1e7
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
Thu Jul 17 13:47:56 CEST 2008 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
* src/virsh.c: patch from Evgeniy Sokolov for the undefine command
|
* src/virsh.c: patch from Evgeniy Sokolov for the undefine command
|
||||||
|
@ -487,7 +487,23 @@ static int
|
|||||||
virStorageBackendFileSystemMount(virConnectPtr conn,
|
virStorageBackendFileSystemMount(virConnectPtr conn,
|
||||||
virStoragePoolObjPtr pool) {
|
virStoragePoolObjPtr pool) {
|
||||||
char *src;
|
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,
|
MOUNT,
|
||||||
"-t",
|
"-t",
|
||||||
pool->def->type == VIR_STORAGE_POOL_FS ?
|
pool->def->type == VIR_STORAGE_POOL_FS ?
|
||||||
@ -495,10 +511,20 @@ virStorageBackendFileSystemMount(virConnectPtr conn,
|
|||||||
pool->def->source.format) :
|
pool->def->source.format) :
|
||||||
virStorageBackendFileSystemNetPoolFormatToString(conn,
|
virStorageBackendFileSystemNetPoolFormatToString(conn,
|
||||||
pool->def->source.format),
|
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,
|
pool->def->target.path,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (netauto) {
|
||||||
|
mntargv = netfs_auto_argv;
|
||||||
|
source_index = 1;
|
||||||
|
} else {
|
||||||
|
mntargv = fs_argv;
|
||||||
|
source_index = 3;
|
||||||
|
}
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
|
if (pool->def->type == VIR_STORAGE_POOL_NETFS) {
|
||||||
@ -543,7 +569,7 @@ virStorageBackendFileSystemMount(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mntargv[3] = src;
|
mntargv[source_index] = src;
|
||||||
|
|
||||||
if (virRun(conn, (char**)mntargv, NULL) < 0) {
|
if (virRun(conn, (char**)mntargv, NULL) < 0) {
|
||||||
VIR_FREE(src);
|
VIR_FREE(src);
|
||||||
|
Loading…
Reference in New Issue
Block a user