Commit Graph

161 Commits

Author SHA1 Message Date
David Scott
96a0dff1be Fix the RPM build on CentOS 5.5
This is needed because prefix is being set directly to $(DESTDIR) in Makefile.in
2011-07-12 14:47:33 +01:00
Ronnie Sahlberg
caf8ade440 Update the QEMU patch to work against current qemy master branch 2011-06-12 12:59:57 +10:00
Ronnie Sahlberg
0be42c8833 If an application specifies zero-copy read-buffers to read the data into
for a read10 call, the application might have specified too few buffers
for the full I/O.
For example if the application tries to read just 512 bytes off a MMC device.

In this case we wopuld run out of buffers and fail with a SEGV.

Instead of failing like this, return NULL from the function to locate a suitable buffer and read the remaining data from the command into the callback buffer instead, just like when no read-buffer at all has been specified.
2011-06-12 10:44:31 +10:00
Ronnie Sahlberg
de97dbdde8 start implementing mode page unmarshalling 2011-04-23 14:02:59 +10:00
Ronnie Sahlberg
8bc4150e31 Fix typo in a printed string 2011-04-22 12:23:53 +10:00
Ronnie Sahlberg
9aaf1e5de4 Add tests for invalid READ6 commands 2011-04-22 12:03:51 +10:00
Ronnie Sahlberg
2838e6f6ac Add tests for reading beyong eol for READ6 2011-04-22 11:41:33 +10:00
Ronnie Sahlberg
4355462cf9 Qemu patch. Update the qemu patch to provide task management abort task
when the qemu cancels an i/o.

Update the patch to use FUA on all writes when qemu is in writethrough
mode.

Update to apply and compile against current master for qemu
2011-04-22 07:53:01 +10:00
Ronnie Sahlberg
7a4b1d2640 Fix documentation of how to use 'zero-copy' reads.
The function to specify the read buffers is called
scsi_task_add_data_in_buffer, not scsi_task_add_data_buffer

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2011-04-22 07:51:47 +10:00
Ronnie Sahlberg
3a39201543 Add 'zero-copy' in libiscsi for reads.
It is not real zero-copy since the data is still copied in the kernel,
but it avoids copying the data inside libiscsi as well as in the callback.

For SCSI tasks that will return data from the target, the application can now
specify application buffers for libiscsi to read the data directly into.
This is done by calling scsi_task_add_data_in_buffer(task, ...

These buffers need not be linear, you can specify different areas to read into
by calling this function several times.

See examples/iscsiclient.c for an example.
2011-04-20 05:46:17 +10:00
Ronnie Sahlberg
acc2871ab0 Fix the 4 residual tests for read10 2011-04-18 17:38:50 +10:00
Ronnie Sahlberg
7fe457cea8 We can get over/underflow residuals in a DATA-IN segment if/when the S bit is set too. 2011-04-18 17:31:47 +10:00
Ronnie Sahlberg
ea6079d953 run all tests in t0105 even if one of the tests fail 2011-04-18 12:49:14 +10:00
Ronnie Sahlberg
8007398b9b Add a few more tests of READ10 with a mismatch between the amount of data
specified in the CDB XFERLENGTH and the iSCSI EDTL
2011-04-17 06:50:20 +10:00
Ronnie Sahlberg
26ad3da518 Add a description if iscsi-test to the README file 2011-04-16 16:54:19 +10:00
Ronnie Sahlberg
51ef550414 Add -f to rm when cleaning up to get rid of error message when running make clean twice 2011-04-16 16:49:10 +10:00
Ronnie Sahlberg
a1715ae21a Add a simple SCSI test tool.
For now focused on SBC but should be enhanced to cover other commandsets too
2011-04-16 16:47:38 +10:00
Ronnie Sahlberg
f4ef49e068 Add missing prototype for the read6 cdb function 2011-04-16 16:29:00 +10:00
Ronnie Sahlberg
3a29351dac Read out the residual count correctly from the scsi reply 2011-04-16 16:28:40 +10:00
Ronnie Sahlberg
4551b01104 compiler warning about unusued variable 2011-04-16 16:28:30 +10:00
Ronnie Sahlberg
024f7dc94e In iscsi_scsi_response_cb()
dont pick task up from the argument, since this callback can be invoked
from places where we dont have/know the task strucutre and it is thus NULL.

Instead pick it up from scsi_cbstruct.

This prevents a SEGV when processing REJECT to SCSI commands.
(the scsi command callback dereferences the task pointer)
2011-04-16 13:51:32 +10:00
Ronnie Sahlberg
49dd0fb8b3 Add definition of INVALID OPERATION CODE asqc 2011-04-16 09:55:48 +10:00
Ronnie Sahlberg
07ad0572f2 Add support for READ6 2011-04-16 08:06:16 +10:00
Ronnie Sahlberg
b6782dd7c8 TCP KEEPALIVE support
Add tcp keeplaive support on platforms that support these socket options.
Set default to fail the socket after 120 seconds
2011-04-13 21:37:28 +10:00
Ronnie Sahlberg
120f41f225 TODO: Update TODO to reflect we now do target driven NOPs 2011-04-10 15:37:19 +10:00
Ronnie Sahlberg
ef846b0f30 Target initiated NOP:
Initial support to try to respond to target initiated NOPs.
2011-04-10 15:33:42 +10:00
Ronnie Sahlberg
cfe19486ee Add RESERVATION CONFLICT
From Richard Sharpe,  add support to handle when a target responds with
RESERVATION CONFLICT to a scsi i/o
2011-04-09 12:00:10 +10:00
Ronnie Sahlberg
bceb3d058d TYPO: fix error strings to "trying TO send ..." 2011-04-06 17:47:55 +10:00
Ronnie Sahlberg
e93ad2f039 Fix a cut-n-paste typo in an error message 2011-04-05 12:24:59 +10:00
Ronnie Sahlberg
1a5f267b1d WRITE10: Set W bit to 1 only if we write data, i.e. number of blocks are >0 2011-04-04 18:47:32 +10:00
Ronnie Sahlberg
e7300bfb8b READ10: only set R flag in iscsi if we are reading >0 blocks.
If we are reading 0 blocks, the R flag should be clear
2011-04-04 18:34:38 +10:00
Ronnie Sahlberg
5225b5fa66 Add definitions for ASCQ LBA-OUT-OF-RANGE 2011-04-04 17:40:13 +10:00
Ronnie Sahlberg
376f60fc06 Use ioctl(FIONREAD) to determine how many bytes are readable in the socket
and make sure we dont try to read mor than that.
2011-04-03 07:22:05 +10:00
Ronnie Sahlberg
4979b7346f From Richard Sharpe
Add a mechanism where residual overflow/underflow can be reportad back to
the application

We probably need somethinf for bidir residuals at some stage too
2011-03-27 19:27:10 +11:00
Ronnie Sahlberg
2c932a1869 README: document we have support patches for kvm/qemu, sg3utils and mtx 2011-03-27 19:06:11 +11:00
Ronnie Sahlberg
e98030123d KVM/QEMU patch to make iscsi aware 2011-03-27 19:03:14 +11:00
Ronnie Sahlberg
53dda35d38 Add patch to provide iscsi functionality in the MTX package 2011-03-27 18:30:12 +11:00
Ronnie Sahlberg
40d3928c64 oops used the wrong sg3 patch
this adds the right sg3 patch to iscsi enable sg3 utils
2011-03-27 18:24:34 +11:00
Ronnie Sahlberg
343d86dca7 get rid of the _async() scsi functions.
We dotn need two interfaces that only diuffer in whether they return a pointer or NULL vs an semiidentical interface that returns 0 or <0

All uses of _async() for scsi tasks should be replaced with the equivalent _task() function instead
2011-03-27 18:17:12 +11:00
Ronnie Sahlberg
cedcc55796 Add SG3 utils patch to the patches subdirectory 2011-03-27 18:00:55 +11:00
Ronnie Sahlberg
f4f6ef5033 change dont automatically free the scsi_task once the callback completes.
Freeing the scsi_task structure is the responsibility of the application
to either do so during the callback, or later.
2011-03-27 17:53:05 +11:00
Ronnie Sahlberg
4e6e39ee23 Support for REJECT PDUs. 2011-02-27 13:49:49 +11:00
Ronnie Sahlberg
8784a72f0e ISCSICLIENT update the example to use the _task() function for task management 2011-02-27 10:35:49 +11:00
Ronnie Sahlberg
3561dbbd61 Document the async _task() functions 2011-02-27 10:32:23 +11:00
Ronnie Sahlberg
76208e1eff Rename the _send() functions to _task()
These functions are also async functions for SCSI commands but they return
a task structure or NULL.

This task structure can be used in task management functions to abort the task or a whole task set.
2011-02-27 10:29:51 +11:00
Ronnie Sahlberg
bdbf6b5d00 Dont free the scsi task from iscsi_scsi_command_async(), leave that for the caller to do if required. 2011-02-25 15:53:56 +11:00
Ronnie Sahlberg
356a6571bb Login: remember what the TargetAddress returned during login is so we can
handle redirect 'errors'.
2011-02-25 15:35:49 +11:00
Ronnie Sahlberg
e9749ee68c Add ifdefs to protect the header files from being included
multiple times

From Richard Sharpe
2011-02-25 14:25:45 +11:00
Ronnie Sahlberg
b5c1c8705a Merge branch 'prefix_fix' of https://github.com/stefanha/libiscsi into stefanha-prefix_fix 2011-02-25 14:11:28 +11:00
Ronnie Sahlberg
d1fdaef5c6 Username/password separator: Allow ':' to separate the chap username/password in addition to '%' 2011-02-20 10:44:53 +11:00