Skip to content

Commit df86025

Browse files
ikegami-tigaw
authored andcommitted
fabrics: Add EADDRNOTAVAIL error mapping
Signed-off-by: Tokunori Ikegami <[email protected]>
1 parent 4154f98 commit df86025

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/nvme/fabrics.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,9 +779,12 @@ static int __nvmf_add_ctrl(nvme_root_t r, const char *argstr)
779779
case EOPNOTSUPP:
780780
ret = -ENVME_CONNECT_OPNOTSUPP;
781781
break;
782-
case ECONNREFUSED :
782+
case ECONNREFUSED:
783783
ret = -ENVME_CONNECT_CONNREFUSED;
784784
break;
785+
case EADDRNOTAVAIL:
786+
ret = -ENVME_CONNECT_ADDRNOTAVAIL;
787+
break;
785788
default:
786789
ret = -ENVME_CONNECT_WRITE;
787790
break;

src/nvme/util.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,9 @@ static const char * const libnvme_status[] = {
567567
[ENVME_CONNECT_INVAL] = "invalid arguments/configuration",
568568
[ENVME_CONNECT_ADDRINUSE] = "hostnqn already in use",
569569
[ENVME_CONNECT_NODEV] = "invalid interface",
570-
[ENVME_CONNECT_OPNOTSUPP] ="not supported",
570+
[ENVME_CONNECT_OPNOTSUPP] = "not supported",
571571
[ENVME_CONNECT_CONNREFUSED] = "connection refused",
572+
[ENVME_CONNECT_ADDRNOTAVAIL] = "cannot assign requested address",
572573
};
573574

574575
const char *nvme_errno_to_string(int status)

src/nvme/util.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
* @ENVME_CONNECT_ADDRINUSE: hostnqn already in use
3737
* @ENVME_CONNECT_NODEV: invalid interface
3838
* @ENVME_CONNECT_OPNOTSUPP: not supported
39-
* @ENVME_CONNECT_CONNREFUSED: connection refused
39+
* @ENVME_CONNECT_CONNREFUSED: connection refused
40+
* @ENVME_CONNECT_ADDRNOTAVAIL: cannot assign requested address
4041
*/
4142
enum nvme_connect_err {
4243
ENVME_CONNECT_RESOLVE = 1000,
@@ -57,6 +58,7 @@ enum nvme_connect_err {
5758
ENVME_CONNECT_NODEV,
5859
ENVME_CONNECT_OPNOTSUPP,
5960
ENVME_CONNECT_CONNREFUSED,
61+
ENVME_CONNECT_ADDRNOTAVAIL,
6062
};
6163

6264
/**

0 commit comments

Comments
 (0)