Commit Graph

2061 Commits

Author SHA1 Message Date
Bart Van Assche
6cdb47b9b4 configure.ac: Avoid that automake complains that AM_PROG_AR is missing
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
2014-08-02 08:29:26 -07:00
Ronnie Sahlberg
85cbf3c10e iscsi-dd.c: Don't use %lu for 64 bit integers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-08-02 08:19:17 -07:00
Ronnie Sahlberg
7d96336d52 TESTS: don't check that UNMAP actually unmapped the blocks
We can not test that UNMAP will actually unmap anything even if
it returned status GOOD from the device.
Devices are allowed to "do nothing and return status GOOD" whenever they
want to.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-23 17:22:16 -07:00
Ronnie Sahlberg
9d3d40ae14 Typo
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-21 11:26:45 -07:00
Ronnie Sahlberg
8c27635c5d New version 1.12.0
- Fix bug in statsn wrapping
- Add support for async events

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-21 07:36:03 -07:00
Ronnie Sahlberg
cefb6a6127 TESTS: update the get_lba_status + unmap test to account for lbppbe
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-16 05:37:34 -07:00
Ronnie Sahlberg
e09d5fcefc Typo
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-14 20:29:23 -07:00
Ronnie Sahlberg
a41ec1fe60 TESTS: Add tests that get_lba_status for a single range works
Add a test for unmapping a single range of blocks and that
get_lba_status returns correct data.

Test unmapping a single block at offsets 0-255

Test unmapping 1-255 blocks at offset 0 and verify that
get_lba_status at LBA 0 returns a descriptor of 1-255 blocks.
get_lba_status at the last block of the unmapped range returns
a descriptor for a single block.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-14 19:46:12 -07:00
Ronnie Sahlberg
f0ebbdc203 Merge pull request #128 from plieven/revert_iovector
socket: rename max_read parameter to count in iscsi_iovector_readv_write...
2014-07-14 06:24:05 -07:00
Peter Lieven
53e38dff7d socket: rename max_read parameter to count in iscsi_iovector_readv_writev
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-07-14 15:05:19 +02:00
Ronnie Sahlberg
a0d09ca9de Merge pull request #127 from plieven/revert_iovector
Revert "Rewrite and simplify iscsi_iovector_readv_writev"
2014-07-14 05:56:12 -07:00
Ronnie Sahlberg
6ea698eed0 Merge pull request #126 from plieven/async_avoid_busy_wait
iscsi_which_events: do not set POLLOUT if context is corked
2014-07-14 05:55:20 -07:00
Peter Lieven
59e4a07129 Revert "Rewrite and simplify iscsi_iovector_readv_writev"
Since writing headers and payload in a single iov has never been
implementend and after thinking about it several times seems to
be very hairy I would like to revert this change since
the original implementation is in O(1) while the changed one
is in O(n). This results in a complexity of O(n^2) instead of
O(n) for the whole send operation.

This reverts commit 06eab264f6.
2014-07-14 08:05:32 +02:00
Peter Lieven
4b3f4b5822 iscsi_which_events: do not set POLLOUT if context is corked
if the socket is corked we otherwise set POLLOUT and then
do not sent. Depending on the event loop implementation this
can result in a busy wait.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-07-14 08:02:24 +02:00
Ronnie Sahlberg
6285ba72b7 iscsi-swp: Check user[0]!=0 instead of user!=NULL. user is no longer a pointer.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-13 17:19:24 -07:00
Ronnie Sahlberg
062dc151aa Merge pull request #108 from bonzini/reconnect-dangling-pointer-fix
libiscsi: fix dangling pointer for outqueue_current
2014-07-13 16:47:11 -07:00
Ronnie Sahlberg
ada1fc2008 Merge pull request #123 from plieven/asyncv3
add support for async messages
2014-07-13 16:46:27 -07:00
Ronnie Sahlberg
8e6af982a4 Merge pull request #125 from plieven/iscsi-test
iscsi-test: check for invalid descriptors offsets in get_lba_status
2014-07-13 16:35:19 -07:00
Ronnie Sahlberg
175be58c06 Merge pull request #118 from plieven/for-ronnie
examples: additional options to iscsi-dd
2014-07-13 16:33:20 -07:00
Ronnie Sahlberg
d44e9bd94f Merge pull request #116 from plieven/export_uint64
include: add prototypes for scsi_{get,set}_uint64
2014-07-13 16:32:06 -07:00
Ronnie Sahlberg
0693c10b63 bump api version in iscsi.h
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-07-13 16:31:15 -07:00
Ronnie Sahlberg
c6d8ddba04 Merge pull request #114 from bonzini/iscsi-soname
bump ABI version again
2014-07-13 16:30:14 -07:00
Peter Lieven
d6af861c57 iscsi-test: check for invalid descriptors offsets in get_lba_status
Dell Equallogic sans report an invalid LBA offset in the descriptor when
using 4k LUNs. Check the descriptor for consistency with the request.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-07-10 14:44:16 +02:00
Paolo Bonzini
ce0723320c libiscsi: fix dangling pointer for outqueue_current
The outqueue_current PDU might also be in waitpdu if it does not have
ISCSI_PDU_DELETE_WHEN_SENT.  outqueue_current is freed after the
waitpdu list (for reconnect or defer_reconnect), or sometimes not
considered at all (for cancel), and this can cause a dangling pointer.

Keep outqueue_current up to date when a PDU is freed.  A bit hacky,
but it avoids touching code all over the place.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-17 14:59:50 +02:00
Peter Lieven
4e129d385c pdu: fix statsn and factor out sn comparision
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:58:38 +02:00
Peter Lieven
52c6b0d397 pdu: check callback on iscsi_process_reject
if the rejected packet is a NOP-Out it is legal
that it has no callback. In this case we end
up in a segfault.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:57:52 +02:00
Peter Lieven
e6894fd73a iscsi-command: do not fail commands while reconnect is pending
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:56:57 +02:00
Peter Lieven
f14f3ef6fe pdu: handle async events 2,3,4
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:56:43 +02:00
Peter Lieven
21e02c2078 pdu: catch rejected packets while target waits for logout
after a target has send the async target requests logout event it may
reject each request with a waiting for logout reason. Catch these
rejects if an outstanding request and the logout event overlap.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:54:05 +02:00
Peter Lieven
81921e3762 pdu: handle async target requests logout events
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:52:27 +02:00
Peter Lieven
98bbeab664 pdu: introduce ISCSI_PDU_URGENT_DELIVERY
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:50:41 +02:00
Peter Lieven
344b21d37d logout: allow additional PDU flags to be passed internally
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:43:54 +02:00
Peter Lieven
e940f95769 logout: cork socket after logout has been sent
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:42:21 +02:00
Peter Lieven
99585b6996 pdu: introduce ISCSI_PDU_CORK_WHEN_SENT
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:42:08 +02:00
Peter Lieven
5d55d32adb socket: do not stop sending for immediate PDUs
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-17 14:42:00 +02:00
Peter Lieven
8e7b0a71bb examples: iscsi-dd add option to ignore errors
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-16 18:29:24 +02:00
Peter Lieven
c2a285760d examples: additional options to iscsi-dd
this adds progress output, 16 byte CDB support, additional checks and user
settable max_in_flight and blocks_per_io.

Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-16 18:09:19 +02:00
Peter Lieven
16165a240f include: add prototypes for scsi_{get,set}_uint64
Signed-off-by: Peter Lieven <pl@kamp.de>
2014-06-16 09:39:53 +02:00
Paolo Bonzini
267343dca5 bump ABI version again
1.10 and 1.11 both introduced incompatible changes to the
libiscsi ABI.  Please do not do that, and feel free to Cc
me on any patch that touches include/.  In the meanwhile,
bump the soname of the library.  I suggest releasing 1.11.1
with this change for distros.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-06-10 13:38:46 +02:00
Ronnie Sahlberg
20b4f9a3fb tests: remove deprecated test tool iscsi-test
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-05-20 18:05:57 -07:00
Ronnie Sahlberg
e66b50f8ec tests: use alloca when allocating scratch buffer for writesame
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-05-20 17:52:23 -07:00
Ronnie Sahlberg
b7089d64e1 Merge pull request #111 from jpocas/upstream
- test_unmap_simple: was assuming that zero buffer was already cleared, ...
2014-05-20 17:48:17 -07:00
Ronnie Sahlberg
b3d2db71ed Merge pull request #112 from jpocas/ws10_ws16_unmap_fix
- writesame10 and writesame16 were looking at the datalen, when they wan...
2014-05-20 17:46:01 -07:00
jpocas
69c466a6c9 - writesame10 and writesame16 were looking at the datalen, when they wanted to be looking at the number of blocks 2014-05-07 13:49:25 -04:00
jpocas
b0c57802bc - test_unmap_simple: was assuming that zero buffer was already cleared, which is not guaranteed and resulted in spurious failures
- writesame10_unmap_until_end, writesame16_unmap, writesame16_unmap_until_end were doing an CU_ASSERT *PER-BYTE* in the verification phase,
which was very CPU-intensive. This change uses memcmp on a whole block which finishes much quicker.
2014-05-07 13:32:21 -04:00
Michael Tokarev
14b5faf11e examples/ld_iscsi.c: format string int on 32bit
This patch uses appropriate format string specifiers for uint64_t
types taken from inttypes.h, instead of using %lu, because %lu is
wrong at least on 32bit architecture.

Also, cast size_t expressions to unsigned long, again, because on at least
32bit architectures, size_t is int, not long.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-05-07 06:50:48 -07:00
Michael Tokarev
d7ab603ba0 format string cast ptrdiff on 32bit arch (#747262)
Cast ptrdiff (diff between two pointers) to long to fix printfs.
This fixes FTBFS on 32bit architectures.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-05-07 06:49:02 -07:00
Ronnie Sahlberg
717b95cb8a slist.h: rename SLIST_ to ISCSI_LIST_ to avoid clash on *BSD
Rename the macros for managing the linked lists from SLIST_* to ISCSI_LIST_*
to avoid a clash on *BSD which already have other macros SLIST_*

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-05-07 06:44:19 -07:00
Ronnie Sahlberg
fe669580ee New version 1.11.0
This version contains changes for:
 - Fix memory leaks in persistent reserve out.
 - Fix various leaks in the testsuite.
 - Add additional READ16 tests
 - Better logging when reconnect fails.
 - Discovery and Login fixes.
 - Various fixes found by coverity.
 - WRITESAME test updates.
 - Add XML oputput support for the testsuite.
and various other things.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2014-04-19 12:06:45 -07:00
Paolo Bonzini
0bbda35941 libiscsi: fix dangling pointer for outqueue_current
The outqueue_current PDU might also be in waitpdu if it does not have
ISCSI_PDU_DELETE_WHEN_SENT.  outqueue_current is freed after the
waitpdu list (for reconnect or defer_reconnect), or sometimes not
considered at all (for cancel), and this can cause a dangling pointer.

Keep outqueue_current up to date when a PDU is freed.  A bit hacky,
but it avoids touching code all over the place.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2014-04-02 16:07:15 +02:00