rpc: only dump [Rpc] section if config is set
The config_text callback should only add a [Rpc] section if an address is configured. This avoids printing out a bogus configuration file section with "Listen (null)". Change-Id: Ibb734f6faab4c2587203623eee8a193f9a7207ba Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/390328 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
5f0c99c018
commit
c24c1cce4b
@ -98,10 +98,17 @@ spdk_rpc_finish(void)
|
||||
void
|
||||
spdk_rpc_config_text(FILE *fp)
|
||||
{
|
||||
const char *listen_addr;
|
||||
|
||||
listen_addr = rpc_get_listen_addr();
|
||||
if (listen_addr == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(fp,
|
||||
"\n"
|
||||
"[Rpc]\n"
|
||||
" # Listen address for the RPC service.\n"
|
||||
" # May be an IP address or an absolute path to a Unix socket.\n"
|
||||
" Listen %s\n", rpc_get_listen_addr());
|
||||
" Listen %s\n", listen_addr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user