Commit a47ce229 authored by Konrad Sztyber's avatar Konrad Sztyber
Browse files

nvmf: add stubs for mdns functions



These functions are only defined if configured with avahi support.  By
having stubs, we can get remove some of the #ifdefs and it'll make it
possible to call these functions from other places in code.

Signed-off-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
Change-Id: I0ba660f526013c5292e9cd2b043393fd6a177801
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24408


Reviewed-by: default avatarKyuho Son <kyuho.son@samsung.com>
Community-CI: Mellanox Build Bot
Reviewed-by: default avatarTomasz Zawadzki <tomasz@tzawadzki.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent 067f7c7f
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -3022,12 +3022,6 @@ static void
rpc_nvmf_publish_mdns_prr(struct spdk_jsonrpc_request *request,
			  const struct spdk_json_val *params)
{
#ifndef SPDK_CONFIG_AVAHI
	SPDK_ERRLOG("nvmf_publish_mdns_prr is supported when SPDK is built with the --with-avahi option.\n");
	spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
					 "nvmf_publish_mdns_prr is supported when SPDK is built with the --with-avahi option.");
	return;
#endif
	int rc;
	struct rpc_mdns_prr req = { 0 };
	struct spdk_nvmf_tgt *tgt;
@@ -3066,13 +3060,6 @@ static void
rpc_nvmf_stop_mdns_prr(struct spdk_jsonrpc_request *request,
		       const struct spdk_json_val *params)
{
#ifndef SPDK_CONFIG_AVAHI
	SPDK_ERRLOG("nvmf_stop_mdns_prr is supported when SPDK is built with the --with-avahi option.\n");
	spdk_jsonrpc_send_error_response(request, SPDK_JSONRPC_ERROR_INVALID_PARAMS,
					 "nvmf_stop_mdns_prr is supported when SPDK is built with the --with-avahi option.");
	return;
#endif

	struct rpc_mdns_prr req = { 0 };
	struct spdk_nvmf_tgt *tgt;

+15 −0
Original line number Diff line number Diff line
@@ -56,3 +56,18 @@ spdk_nvmf_rdma_init_hooks(struct spdk_nvme_rdma_hooks *hooks)
	abort();
}
#endif /* !SPDK_CONFIG_RDMA */

#ifndef SPDK_CONFIG_AVAHI
int
nvmf_publish_mdns_prr(struct spdk_nvmf_tgt *tgt)
{
	SPDK_ERRLOG("nvmf_publish_mdns_prr is supported when built with the --with-avahi option\n");

	return -ENOTSUP;
}

void
nvmf_tgt_stop_mdns_prr(struct spdk_nvmf_tgt *tgt)
{
}
#endif /* !SPDK_CONFIG_AVAHI */