Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions libnvme/src/nvme/fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ static int inet6_pton(struct nvme_global_ctx *ctx, const char *src, uint16_t por

/**
* inet_pton_with_scope - convert an IPv4/IPv6 to socket address
* @r: nvme_root_t object
* @ctx: Global context
* @af: address family, AF_INET, AF_INET6 or AF_UNSPEC for either
* @src: the start of the address string
* @trsvcid: transport service identifier
Expand Down Expand Up @@ -2376,8 +2376,9 @@ static int nvmf_create_discovery_ctrl(struct nvme_global_ctx *ctx,
/* Find out the name of discovery controller */
ret = nvme_ctrl_identify(c, id);
if (ret) {
fprintf(stderr, "failed to identify controller, error %s\n",
nvme_strerror(-ret));
nvme_msg(ctx, LOG_ERR,
"failed to identify controller, error %s\n",
nvme_strerror(-ret));
nvme_disconnect_ctrl(c);
nvme_free_ctrl(c);
return ret;
Expand Down Expand Up @@ -2431,16 +2432,16 @@ int _discovery_config_json(struct nvme_global_ctx *ctx,
/* ignore if no host_traddr for fc */
if (!strcmp(transport, "fc")) {
if (!host_traddr) {
fprintf(stderr, "host_traddr required for fc\n");
nvme_msg(ctx, LOG_ERR, "host_traddr required for fc\n");
return 0;
}
}

/* ignore if host_iface set for any transport other than tcp */
if (!strcmp(transport, "rdma") || !strcmp(transport, "fc")) {
if (host_iface) {
fprintf(stderr,
"host_iface not permitted for rdma or fc\n");
nvme_msg(ctx, LOG_ERR,
"host_iface not permitted for rdma or fc\n");
return 0;
}
}
Expand Down Expand Up @@ -2580,11 +2581,11 @@ int nvmf_connect_config_json(struct nvme_global_ctx *ctx,
if (err == -ENVME_CONNECT_ALREADY)
continue;

fprintf(stderr,
"failed to connect to hostnqn=%s,nqn=%s,%s\n",
nvme_host_get_hostnqn(h),
nvme_subsystem_get_name(s),
nvme_ctrl_get_address(c));
nvme_msg(ctx, LOG_ERR,
"failed to connect to hostnqn=%s,nqn=%s,%s\n",
nvme_host_get_hostnqn(h),
nvme_subsystem_get_name(s),
nvme_ctrl_get_address(c));

if (!ret)
ret = err;
Expand Down Expand Up @@ -3233,8 +3234,9 @@ static int nvmf_create_discover_ctrl(struct nvme_global_ctx *ctx,
/* Find out the name of discovery controller */
ret = nvme_ctrl_identify(c, id);
if (ret) {
fprintf(stderr, "failed to identify controller, error %s\n",
nvme_strerror(-ret));
nvme_msg(ctx, LOG_ERR,
"failed to identify controller, error %s\n",
nvme_strerror(-ret));
nvme_disconnect_ctrl(c);
nvme_free_ctrl(c);
return ret;
Expand Down
3 changes: 2 additions & 1 deletion libnvme/src/nvme/linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ int nvme_get_uuid_list(struct nvme_transport_handle *hdl, struct nvme_id_uuid_li
nvme_init_identify_ctrl(&cmd, &ctrl);
err = nvme_submit_admin_passthru(hdl, &cmd);
if (err) {
fprintf(stderr, "ERROR: nvme_identify_ctrl() failed 0x%x\n", err);
nvme_msg(hdl->ctx, LOG_ERR,
"ERROR: nvme_identify_ctrl() failed 0x%x\n", err);
return err;
}

Expand Down