summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2019-07-25 11:00:29 +0530
committerAmar Tumballi <amarts@redhat.com>2019-07-31 00:53:11 +0000
commit7124fc6d01aa23e9a218d0ce608242d0ae320193 (patch)
treee6d2b75927e9562baf26d6f727e6008db0e79afe /api
parenta31fad885c30cbc1bea652349c7d52bac1414c08 (diff)
gfapi: increase function-coverage
* Add few more mgmt functions to the coverage * While testing mgmt function, found an issue, where if the 'glfs_set_volfile_server()' is not called before calling 'glfs_unset_volfile_server()', unset would cause a crash. Null check of few variables fixes the issue, which is handled in this patch itself. * Added a test for volfile API Updates: bz#1693692 Change-Id: Iba151f8da1b64107e2f436ddbfef9da45b1c1588 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'api')
-rw-r--r--api/src/glfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/api/src/glfs.c b/api/src/glfs.c
index f5c9d54..1debec9 100644
--- a/api/src/glfs.c
+++ b/api/src/glfs.c
@@ -369,6 +369,8 @@ pub_glfs_unset_volfile_server(struct glfs *fs, const char *transport,
list_for_each_entry_safe(server, tmp, &cmd_args->curr_server->list, list)
{
+ if (!server->volfile_server || !server->transport)
+ continue;
if ((!strcmp(server->volfile_server, host) &&
!strcmp(server->transport, transport_val) &&
(server->port == port_val))) {