Commit Graph

597 Commits

Author SHA1 Message Date
Ronnie Sahlberg 801bfb342d Login: dont fail the login just because there is no media in a device
in that case we will never reach test unit ready being successful since it will fail with NOT_READY/MEDIUM_NOT_PRESENT.
Treat this sense code as a successful login as far as the login process is concerned
2012-07-11 15:33:32 +10:00
Ronnie Sahlberg cadc1650e1 Add ASCQ for MEDIUM_NOT_PRESENT 2012-07-10 16:40:58 +10:00
Yuri Pankov 2a0ad3bd2d FreeBSD and illumos do not define SOL_TCP 2012-06-20 02:54:34 +04:00
Ronnie Sahlberg b23547546f LOGIN commands NEVER use header digest since even if the login is spanning multiple PDU sequences it is still treated as one logical operation.
Dont update the header_digest setting until we have finished login and are transitioning to the full-feature phase.
2012-06-17 12:37:13 +10:00
Ronnie Sahlberg d5f646099d READ10/WRITE10: Change these functions to sue the same signatures as the other READ/WRITE
Harmonize the signatures for READ10/WRITE10 to match the ones for READ12/16 and WRITE12/16

This breaks the API/ABI so this forces the next version of the library to bump the major version to 2.0

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-06-05 19:20:02 +10:00
Ronnie Sahlberg 9130d2eb45 Add support for VERIFY12 and tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-06-04 20:35:15 +10:00
Ronnie Sahlberg 6003000809 Add VERIFY16 support and tests
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-06-04 20:16:44 +10:00
Ronnie Sahlberg 9e09a46ddd LOGIN: Once the login phase has finished, bump ITT by one
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-06-02 17:51:10 +10:00
Ronnie Sahlberg 819248a519 LOGIN: Dont increment the ITT if the target wants another round of LOGIN
If the login phase takes multiple login requests we should keep the ITT the same for all login requets and not increment it.
A multi-phase login is only a single task eventhough it may be spread across multiple login requetst.

While most targets are forgiving and still work if we increment the ITT for each login command, some targets such as SOLARIS/COMSTAR is NOT forgiving if we break the protocol in this situation.

Fix the ITT handling so that we dont make SOLARIS/COMSTAR upset.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-06-02 15:41:38 +10:00
Ronnie Sahlberg 812df62bfd SBC: Add GET_LBA_STATUS support and simple test 2012-05-30 18:41:12 +10:00
Ronnie Sahlberg 6be4a82407 Remove some unused variables 2012-05-30 18:23:15 +10:00
Ronnie Sahlberg 824a33c834 win32 set the socket to nonblocking moe for win32 2012-05-15 22:08:10 +10:00
Ronnie Sahlberg dafa186868 win32: connect.c needs the compatibility functions 2012-05-15 21:54:10 +10:00
Ronnie Sahlberg 201d6c3b54 win32: sinc.c need the compatibility header so it finds the replacement for poll() 2012-05-15 21:51:53 +10:00
Ronnie Sahlberg 05d2f81a84 win32: unistd.h is not available under win32 2012-05-15 21:45:30 +10:00
Ronnie Sahlberg ec0d9682a7 Dont use FIONREAD just rely on the fact the socket is nonblocking and look for EAGAIN when we reach the end of available data.
From Paolo Bonzini <pbonzini@redhat.com>
2012-05-15 20:32:37 +10:00
Ronnie Sahlberg 83730f7d4c w32: dont export our version of poll. 2012-05-13 17:21:53 +10:00
Ronnie Sahlberg 1c63b55e20 W32: update libiscsi.def with all new and missing symbols 2012-05-13 17:05:25 +10:00
Ronnie Sahlberg ed4b8ec72e W32: Remove our poor emulation of poll() from the w32 build. 2012-05-13 16:46:38 +10:00
Michael Tokarev 261924d73a export only required symbols, do not export internal symbols from the library
Hopefully I collected the list of symbols to expot correctly.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2012-05-12 08:46:06 +10:00
Michael Tokarev aee0e3bf72 always export iscsi_set_tcp_keepalive()
Set only the (socket) options which are defined on a given platform.
The function becomes a no-op if no option is known at complie time.
Remove autoconf test for HAVE_TCP_KEEPALIVE too.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2012-05-12 08:41:34 +10:00
Ronnie Sahlberg c91de1e35a We might be called by some eventsystems with POLLIN eventhough there is
no data to read from the socket and there is no error.
For this case, if FIONREAD tells us that there are 0 bytes to read, check if
there is a socket error and return ok/error based on that.

Some eventsystems may cause this to burn some cpu if the socket is ok
but there are no bytes available to read by invoking POLLIN over and over, but it is better than failing the application.
2012-05-10 20:04:22 +10:00
Ronnie Sahlberg 733b97f4b8 Add PREFETCH10/16 implementations 2012-05-03 06:21:49 +10:00
Ronnie Sahlberg 974738968d Implement READ/WRITE_12/16 and a simple test for read16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-05-01 21:54:32 +10:00
Ronnie Sahlberg 9e5535adfd Reconnect: If we are logged in and we experience a session failure, then
try to re-connect and redrive all I/O

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-05-01 18:46:30 +10:00
Ronnie Sahlberg 9c6447b73a SENSE: add a sense key and an ascq 2012-04-28 15:03:43 +10:00
Ronnie Sahlberg 568e4ddfcc SBC: Add support for WRITESAME16 and add simple tests using it to unmap blocks from a thin provisioned lun 2012-04-28 14:34:47 +10:00
Ronnie Sahlberg cc0fa15e14 SBC: Add support for WRITESAME10 and a simple test for using writesame10 to unmap blocks from thin provisioned luns 2012-04-28 13:55:37 +10:00
Ronnie Sahlberg dd5f94b2ca Add support for UNMAP command and add a simple test for this opcode 2012-04-22 08:09:15 +10:00
Ronnie Sahlberg d71a9d4f95 Add support for BLOCK LIMITS VPD page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-04-20 17:57:40 +10:00
Ronnie Sahlberg 86bf89aabf Add support for READCAPACITY16
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-04-20 17:56:39 +10:00
Ronnie Sahlberg 422bc32ce8 Add support for INQUIRY LOGICAL_BLOCK_PROVISIONING page
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-04-19 20:09:14 +10:00
Ronnie Sahlberg 50594830bd Task Management. When we abort a task or a task set, or reset the lun or target
we must also cancel all active tasks.
This will trigger all affected tasks to have their callback invoked with
SCSI_STATUS_CANCELLED
2012-03-10 12:12:47 +11:00
Ronnie Sahlberg cff996a96d VERIFY10: Add support for VERIFY10. Also add a simple test for verify10 2012-01-26 15:47:14 +11:00
Ronnie Sahlberg 6ecf536e86 Rename a varialbe to get rid of compiler warning 2011-12-31 10:31:23 +11:00
Ronnie Sahlberg 114c81390f Remove unused variable 2011-12-31 10:29:41 +11:00
Ronnie Sahlberg d486d466c8 Cast an expression to get rid of a compiler warning 2011-12-31 10:28:34 +11:00
Ronnie Sahlberg f4223d96c7 Remove unused variable 2011-12-31 10:26:43 +11:00
Ronnie Sahlberg 626734e52f Remove an unused variable 2011-12-31 10:25:52 +11:00
Ronnie Sahlberg 8e7e29a52b Remove an unused variable 2011-12-31 10:24:37 +11:00
Ronnie Sahlberg 7b9bdaafb1 TMGMT: dont hardcode the lun we send to to 2, use the lun that is passed in as argument 2011-12-19 15:43:27 +11:00
Ronnie Sahlberg 9bfc3f095d Logout processing is a bit broken since it does not update the cmdsn properly
Copy the code to initialize the cmdsn and expstatsn from nop.c
2011-10-16 13:58:07 +11:00
Ronnie Sahlberg 2f23773390 add sync write10 2011-09-29 22:01:53 +10:00
Paolo Bonzini 217bf6f53e fix warning from -Wswitch 2011-09-21 12:01:39 +02:00
Paolo Bonzini a1975e90f6 fix warning from -Wuninitialized 2011-09-21 12:00:20 +02:00
Paolo Bonzini c940381b59 fix warning from -Wsign-compare 2011-09-21 11:51:36 +02:00
Ronnie Sahlberg 3c11c3598b Add a function to cancel a scsi task from libiscsi. 2011-09-19 21:21:40 +10:00
Ronnie Sahlberg a974e8efe1 When a scsi task / pdu has been cancelled, pass back SCSI_STATUS_CANCELLED to the task callback and not default to SCSI_STATUS_ERROR 2011-09-19 21:12:32 +10:00
Ronnie Sahlberg 0a9049ad65 remove debug messages 2011-09-10 14:02:22 +10:00
Ronnie Sahlberg 49017fda58 OpenSolaris: Add support for opensolaris 2011-09-01 18:04:29 +10:00