Bug 1275568 - libiscsi: return iscsi_err codes from libiscsi calls
libiscsi: return iscsi_err codes from libiscsi calls
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: iscsi-initiator-utils (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Chris Leech
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-27 05:22 EDT by Peter Hatina
Modified: 2017-08-08 08:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-08 08:19:58 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
libiscsi: always return iscsi_err codes instead of standard errno codes (15.79 KB, patch)
2015-10-27 05:24 EDT, Peter Hatina
no flags Details | Diff
remove iscsi_err uninitialized symbol from iscsi_err.h (344 bytes, patch)
2015-10-27 05:25 EDT, Peter Hatina
no flags Details | Diff
spec file: install libiscsi.h and iscsi_err.h (2.96 KB, patch)
2015-10-27 05:32 EDT, Peter Hatina
no flags Details | Diff
top-level libiscsi.h header file (742 bytes, text/plain)
2015-10-27 05:34 EDT, Peter Hatina
no flags Details

  None (edit)
Description Peter Hatina 2015-10-27 05:22:20 EDT
Description of problem:  Always return error codes defined in iscsi_err.h from libiscsi calls.  Errno is too high-level for proper error handling and this makes troubles for consumers to know what happened.  Parsing error string from libiscsi_context isn't "the good way", I think.


Version-Release number of selected component (if applicable):
iscsi-initiator-utils-6.2.0.873-29.git4c9d6f9.fc24

How reproducible:
One of several examples: Try to perform iSCSI login with wrong credentials.

Steps to Reproduce:
1. call libiscsi_node_login() with wrong credentials
2. examine the returned error code

Actual results:
libiscsi_node_login() returns ENOTCONN (107) from errno.h

Expected results:
libiscsI_node_login() returns ISCSI_ERR_LOGIN_AUTH_FAILED (24) from iscsi_err.h

Additional info:
Include path(s) need to be slightly modified. See attached patches from https://github.com/phatina/open-iscsi.
Comment 1 Peter Hatina 2015-10-27 05:24 EDT
Created attachment 1086761 [details]
libiscsi: always return iscsi_err codes instead of standard errno codes

For better error handling, return error codes from iscsi_err.h.
Comment 2 Peter Hatina 2015-10-27 05:25 EDT
Created attachment 1086762 [details]
remove iscsi_err uninitialized symbol from iscsi_err.h

Remove uninitialized, unused iscsi_err symbol from iscsi_err.h.  This makes only troubles, when linking the library to a binary.
Comment 3 Peter Hatina 2015-10-27 05:32 EDT
Created attachment 1086766 [details]
spec file: install libiscsi.h and iscsi_err.h

We need to provide client the enum with proper error codes.  I suggest to install libiscsi.h and iscsi_err.h into %{_includedir}/libiscsi/.


/usr/include/
├── libiscsi
│   ├── iscsi_err.h
│   └── libiscsi.h
└── libiscsi.h
    ^^^^^^^^^^
    libiscsi can be used in the same way as before.
Comment 4 Peter Hatina 2015-10-27 05:34 EDT
Created attachment 1086769 [details]
top-level libiscsi.h header file

Top level header file which includes the actual libiscsi.h and iscsi_err.h and provides unchanged include path.
Comment 5 Jan Kurik 2016-02-24 08:52:46 EST
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
Comment 7 Fedora End Of Life 2017-07-25 15:24:13 EDT
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Comment 8 Fedora End Of Life 2017-08-08 08:19:58 EDT
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.