gfapi: allow transport=NULL for set_volfile_server()
Users of gfapi should not need to care about the supported transport methods, this is an advanced option. Simple use-cases for libgfapi should be able to pass NULL as transport, and the libraries should take care of connecting to the Gluster server(s) correctly. BUG: 1183547 Change-Id: Id93f96a3d10ae9fb69d53192642145ba8deed863 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9464 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
This commit is contained in:
parent
7510d8edf4
commit
cdb3fa6088
@ -375,7 +375,7 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport,
|
||||
server_cmdline_t *tmp = NULL;
|
||||
int ret = -1;
|
||||
|
||||
if (!transport || !host) {
|
||||
if (!fs || !host) {
|
||||
errno = EINVAL;
|
||||
return ret;
|
||||
}
|
||||
@ -400,10 +400,12 @@ pub_glfs_set_volfile_server (struct glfs *fs, const char *transport,
|
||||
goto out;
|
||||
}
|
||||
|
||||
server->transport = gf_strdup (transport);
|
||||
if (!server->transport) {
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
if (transport) {
|
||||
server->transport = gf_strdup (transport);
|
||||
if (!server->transport) {
|
||||
errno = ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
server->port = port;
|
||||
|
Loading…
x
Reference in New Issue
Block a user