Skip to content

Commit

Permalink
fabrics: Add EADDRNOTAVAIL error mapping
Browse files Browse the repository at this point in the history
Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Jun 14, 2023
1 parent 4154f98 commit df86025
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/nvme/fabrics.c
Original file line number Diff line number Diff line change
Expand Up @@ -779,9 +779,12 @@ static int __nvmf_add_ctrl(nvme_root_t r, const char *argstr)
case EOPNOTSUPP:
ret = -ENVME_CONNECT_OPNOTSUPP;
break;
case ECONNREFUSED :
case ECONNREFUSED:
ret = -ENVME_CONNECT_CONNREFUSED;
break;
case EADDRNOTAVAIL:
ret = -ENVME_CONNECT_ADDRNOTAVAIL;
break;
default:
ret = -ENVME_CONNECT_WRITE;
break;
Expand Down
3 changes: 2 additions & 1 deletion src/nvme/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,8 +567,9 @@ static const char * const libnvme_status[] = {
[ENVME_CONNECT_INVAL] = "invalid arguments/configuration",
[ENVME_CONNECT_ADDRINUSE] = "hostnqn already in use",
[ENVME_CONNECT_NODEV] = "invalid interface",
[ENVME_CONNECT_OPNOTSUPP] ="not supported",
[ENVME_CONNECT_OPNOTSUPP] = "not supported",
[ENVME_CONNECT_CONNREFUSED] = "connection refused",
[ENVME_CONNECT_ADDRNOTAVAIL] = "cannot assign requested address",
};

const char *nvme_errno_to_string(int status)
Expand Down
4 changes: 3 additions & 1 deletion src/nvme/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
* @ENVME_CONNECT_ADDRINUSE: hostnqn already in use
* @ENVME_CONNECT_NODEV: invalid interface
* @ENVME_CONNECT_OPNOTSUPP: not supported
* @ENVME_CONNECT_CONNREFUSED: connection refused
* @ENVME_CONNECT_CONNREFUSED: connection refused
* @ENVME_CONNECT_ADDRNOTAVAIL: cannot assign requested address
*/
enum nvme_connect_err {
ENVME_CONNECT_RESOLVE = 1000,
Expand All @@ -57,6 +58,7 @@ enum nvme_connect_err {
ENVME_CONNECT_NODEV,
ENVME_CONNECT_OPNOTSUPP,
ENVME_CONNECT_CONNREFUSED,
ENVME_CONNECT_ADDRNOTAVAIL,
};

/**
Expand Down

0 comments on commit df86025

Please sign in to comment.