Daniel P. Berrange wrote:
On Thu, Jan 08, 2009 at 01:29:12PM +0100, Hans de Goede wrote:
As discussed before I've been working on a simple userspace library for
iscsi
so that various tools (such as anaconda) can use that instead of having to
invoke iscsiadm.
The latest version of the (proposed) API documentation for this library is
here:
http://people.atrpms.net/~hdegoede/html/libiscsi_8h.html
A few random thoughts from reading the API docs
- It is fully synchronous & blocking, which means an app would have
to run it in a separate thread. Not a show-stopper for libvirt since
we already have to run iscisadm in a completely separate process, but
it would be nice to be able to integrate with an app event loop so
we can just poll on I/O completion asynchronously.
- The API for auth credentials is hardcoded to the 4 credentials
needed for CHAP auth. Might be desirable to have a more generic
interface to pass arbitrary credentials to avoid the API being
tied to CHAP.
The iscsi spec allows other auth types. For example some targets
implement Radius (initiator does not implement it yet). I guess we
should make some generic auth struct to pass around?
- Need an API to determine if we're already logged into a specific iSCSI
target - unless there's a reliable error code from iscsi_login() that
lets you identify when it failed due to already being logged in.
Someone will probably want to get the login status and other info about
a running session too, so we maybe we should add some get_session_info
type of call. This would tell if we are logged in or not (it would also
tell us if we are in recovery or in a normal state), and it could pass
the other iscsi info like the current IO stats, and what iscsi settings
we negotiated for (for example the target could want a max IO size of X
bytes and the initiator wanted Y bytes and so we would have negotiated
on the smaller value).
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list