From: Daniel Wagner Date: Wed, 14 Jun 2023 12:17:41 +0000 (+0200) Subject: util: Add ignored error code X-Git-Tag: v1.5~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1c573cde638eba87c2245b178b940f5727477671;p=users%2Fsagi%2Flibnvme.git util: Add ignored error code When libnvme ignores a connection attempt via the 'application' context tracking return an unique error code to allow proper filtering on the caller side. Signed-off-by: Daniel Wagner --- diff --git a/src/nvme/fabrics.c b/src/nvme/fabrics.c index 1222da92..76e1e429 100644 --- a/src/nvme/fabrics.c +++ b/src/nvme/fabrics.c @@ -871,7 +871,7 @@ int nvmf_add_ctrl(nvme_host_t h, nvme_ctrl_t c, if (!app || strcmp(app, root_app)) { nvme_msg(h->r, LOG_INFO, "skip %s, not managed by %s\n", nvme_subsystem_get_nqn(s), root_app); - errno = ENVME_CONNECT_INVAL; + errno = ENVME_CONNECT_IGNORED; return -1; } } diff --git a/src/nvme/util.h b/src/nvme/util.h index 0c1e646c..9d6faf36 100644 --- a/src/nvme/util.h +++ b/src/nvme/util.h @@ -38,6 +38,7 @@ * @ENVME_CONNECT_OPNOTSUPP: not supported * @ENVME_CONNECT_CONNREFUSED: connection refused * @ENVME_CONNECT_ADDRNOTAVAIL: cannot assign requested address + * @ENVME_CONNECT_IGNORED: connect attempt is ignored due to configuration */ enum nvme_connect_err { ENVME_CONNECT_RESOLVE = 1000, @@ -59,6 +60,7 @@ enum nvme_connect_err { ENVME_CONNECT_OPNOTSUPP, ENVME_CONNECT_CONNREFUSED, ENVME_CONNECT_ADDRNOTAVAIL, + ENVME_CONNECT_IGNORED, }; /**