Commit Graph

31 Commits

Author SHA1 Message Date
Stefan Hajnoczi
faec3c0dfd Only await POLLOUT events until connected
Non-blocking socket connect(2) involves waiting for the socket to become
writeable to detect that a connection has been made.  POLLIN events
should not be requested until the socket is connected because they are
processed even if the iSCSI context is not yet connected.

For example, the QEMU iscsi block driver does something like this:

iscsi_full_connect_async(...)

/* Now wait until the socket becomes ready */
poll(POLLIN|POLLOUT) = POLLIN|POLLOUT

/* QEMU calls POLLIN and POLLOUT handlers individually and it happens to
 * call the POLLIN handler *before* the POLLOUT handler.
 */
iscsi_service(POLLIN)
iscsi_service(POLLOUT)

POLLIN processing will read from the socket and consume the error code
if connect failed.  As a result, the POLLOUT handler will write to a
disconnected socket and raise a SIGPIPE which kills the process.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
2010-12-29 08:57:48 +00:00
Ronnie Sahlberg
f449b31150 Change makefile to use -O2 optimizations 2010-12-29 18:02:18 +11:00
Ronnie Sahlberg
647ebd222e Try to resolve hostnames into ip addresses
Dont assume everyone just uses dotted-decimal always on their networks.
Try resolve hostnames specified in the iscsi URLs into addresses
2010-12-28 13:51:54 +11:00
Ronnie Sahlberg
7a7a227fee Suppress a compiler warning 2010-12-27 10:12:45 +11:00
Ronnie Sahlberg
240e250b11 USERNAME / PASSWORD
When failing iscsi-ls due to a missing url, print the url syntax
in the error message before aborting
2010-12-25 12:04:29 +11:00
Ronnie Sahlberg
60718652a4 USERNAME PASSWORD
When generating an error after failing to parse a iscsi url
add username/password to the url syntax that is printed in the error message
2010-12-25 12:00:09 +11:00
Ronnie Sahlberg
ef7ba259b1 TODO
We have CHAP now, and somewhat more sohpisticated login negotiation
so remove those from the TODO list
2010-12-22 22:29:46 +11:00
Ronnie Sahlberg
40abe849b0 CHAP
Add unidirectional chap support so we can authenticate to the target.

Make the login phase more "intelligent" so we can iterate over login
pdus until we have reached full feature phase

Add a new helper functions to parse a iscsi url and break it down
into elements in a structure

Update iscsi-inq to allow CHAP authentication
2010-12-22 22:23:55 +11:00
Ronnie Sahlberg
d53b882682 MAKEFILE
Add md5.o to the makefile
2010-12-22 22:12:38 +11:00
Ronnie Sahlberg
633a08bc22 MD5
Add a public domain implementation of MD5 so we can compute CHAP
The md5 implementation is copied from TGTD
2010-12-22 21:57:58 +11:00
Ronnie Sahlberg
cf0ddbd0d9 URL PARSER
Add a function to parse a common iscsi://... URL so we dont have to re
implement the same code in every application
2010-12-22 18:40:46 +11:00
Ronnie Sahlberg
3ef5a375dc TODO
MTX patch is complete so no longer TODO
2010-12-22 16:57:16 +11:00
Ronnie Sahlberg
79b821db44 LOGIN
We pass header and data separately now so no need to check id size
is less than header size.

Add error reporting of login type and error string describing
the error when login status has failed.
2010-12-22 16:55:48 +11:00
Ronnie Sahlberg
6cb843682f RPM
Install the libiscsi shared library as part of the normal RPM,
not as part of the special devel RPM
2010-12-21 20:09:46 +11:00
Ronnie Sahlberg
61db77394c README
Update readme with text what libiscsi is about
2010-12-21 20:03:13 +11:00
Ronnie Sahlberg
1c024d6bc4 Input processing:
Input processing used to keep all data in one single input buffer, which
makes it hard to handle nested events as well as reading directly from the
socket into the application buffer without an extra copy.

Create a new iscsi_in_pdu structure where we store the header, and any data
for the recevied pdu and store them in a proper input queue.

Change the signature for all processing functions to tahe a iscsi_in_pdu
structure for the received pdu instead of just a pointer to a buffer.
2010-12-11 15:15:51 +11:00
Ronnie Sahlberg
8a6665a092 Licence
Change to LGPL 2.1+ to be compatible with kvm/qemu
2010-12-11 11:47:28 +11:00
Ronnie Sahlberg
dba66b2a7d update the TODO file with suggestion of mtx and dvdrecord as
otential consumers
2010-12-05 18:03:07 +11:00
Ronnie Sahlberg
d124f44469 update intall instructions 2010-12-05 16:13:44 +11:00
Ronnie Sahlberg
5e5a5a2c56 Add autogen/configure to the build instructions.
Update the RPM sepcfile to run autogen/configure
2010-12-05 14:53:02 +11:00
Ronnie Sahlberg
4e5fb3a60b We need libpopt-dev to compile the utilities.
Add a test to configure to verify popt development libraries are available
and print an error and exit otherwise.
2010-12-05 14:48:34 +11:00
Ronnie Sahlberg
1cfeadb015 add a todo list 2010-12-05 14:02:39 +11:00
Ronnie Sahlberg
3d3da6c6e3 include config.h from lib/socket.c and use this to conditionaly
compile code to set sin_len on platforms that require this field
in the sockaddr structures.
2010-12-05 13:53:41 +11:00
Ronnie Sahlberg
631954405a add prefix exec_prefix libdir and bindir to the makefile 2010-12-05 13:40:48 +11:00
Ronnie Sahlberg
d7a1103e13 Add initial autoconf support to make it easier to get ported to
other platforms
2010-12-05 13:31:11 +11:00
Ronnie Sahlberg
709d85c4da Add a COPYING file and updat ehte LGPL boilerplate 2010-12-05 11:11:37 +11:00
Ronnie Sahlberg
4f49ca5d54 Add missing LGPL boilerplate to crc32c.c 2010-12-05 11:11:09 +11:00
Ronnie Sahlberg
32b39f62bd Update iscsi-ls and iscsi-inq
to take the URLs in the form
iscsi://<host>[:<port>]
and
iscsi://<host>[:<port>]/<target-iqn>/<lun>

instead of specifying the values as --portal/--target/--lun
2010-12-05 08:57:10 +11:00
Ronnie Sahlberg
b76c7acb25 Update the readme file to show how to build libiscsi rpms 2010-12-05 08:33:06 +11:00
Ronnie Sahlberg
30177426b4 Update the RPM specfile to point to the githup libiscsi URL 2010-12-05 08:30:59 +11:00
Ronnie Sahlberg
098bc5a9a7 Initial import of libiscsi 2010-12-05 08:24:57 +11:00