Commit Graph

1023 Commits

Author SHA1 Message Date
Ronnie Sahlberg
c5bd95aac9 Remove the use of TCP_CORK 2013-08-04 16:15:22 -07:00
Ronnie Sahlberg
6041dcd136 Add a new function to create a scsi_task using an existing CDB 2013-08-04 14:35:58 -07:00
Ronnie Sahlberg
06eab264f6 Rewrite and simplify iscsi_iovector_readv_writev 2013-08-04 14:34:57 -07:00
Ronnie Sahlberg
7772b9fafd TESTS: Fix memory leak in the VERIFY16 Mismatch test 2013-08-04 14:07:06 -07:00
Ronnie Sahlberg
4ccfe10a70 Merge pull request #71 from bonzini/aliasing-more
use scsi_get/set_uint16/32/64 in tests
2013-08-03 06:52:43 -07:00
Paolo Bonzini
3916872d27 use scsi_get/set_uint16/32/64 in tests
Fixes ARM problems too.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-08-02 17:30:24 +02:00
Ronnie Sahlberg
912b5dc495 Merge pull request #67 from plieven/small_allocations
MEMORY introduce a small allocation pool
2013-08-02 06:45:35 -07:00
Ronnie Sahlberg
eeefd121a8 Merge pull request #69 from bonzini/abi
bump ABI version
2013-08-02 06:40:30 -07:00
Ronnie Sahlberg
327dd42bf0 Merge pull request #70 from bonzini/aliasing-more
More aliasing/alignment fixes
2013-08-02 06:37:38 -07:00
Paolo Bonzini
73ce7f40c8 avoid casting struct sockaddr
On ARM, this produces a warning.  Use a union instead.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-08-02 15:06:16 +02:00
Paolo Bonzini
31a3aeb0e0 fix another aliasing problem
scsi_set_uint64 should just use scsi_set_uint32, similar to
what scsi_get_uint64 does.  This avoids problems on architectures
where "uint32_t" requires more alignment than "char", e.g. ARM.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-08-02 14:07:42 +02:00
Paolo Bonzini
d4a6e4b3e3 bump ABI version
The ABI version was changed many times since the first release, but no
one noticed.  Now that I am packaging a newer version of libiscsi
I need to bump the soname from 1 to 2, which will be (posthumously)
the ABI for 1.9.0.  Declare the next version to have ABI version 3.

Please do not hesitate to ask for review of header-file patches to
catch ABI changes (which should be avoided!).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-08-02 13:04:16 +02:00
Ronnie Sahlberg
e7df1af3b9 TESTS: READ10 and STARTSTOPUNIT should fail while sanitize is in progress
Other commands should fail too  but we dont need to test them all
2013-07-21 14:33:22 -07:00
Ronnie Sahlberg
03f03ce518 TESTS: Inquiry is still allowed while SANITIZE is running 2013-07-21 14:21:16 -07:00
Ronnie Sahlberg
d901700633 Add a test that a sanitize operation will continue across resets
Verify that abort task/abort task set/lun reset/warm reset/cold reset
and full blown session failures will not affect a sanitize that is in
progress
2013-07-21 14:11:13 -07:00
Ronnie Sahlberg
49698e0322 Dont fail the login just because a sanitize is in progress 2013-07-21 14:04:41 -07:00
Ronnie Sahlberg
804c5b0211 Dont reference *pdu after it has been freed 2013-07-21 13:29:43 -07:00
Ronnie Sahlberg
83a0cd90f9 Add SANITIZE_IN_PROGRESS ASCQ 2013-07-21 09:55:35 -07:00
Ronnie Sahlberg
b1b3c603af TESTS: clear unit attention after changing SWP settings in the readonly test 2013-07-21 09:20:00 -07:00
Ronnie Sahlberg
52a83e91af Add POWER_CONDITION modepage marshalling/unmarshalling 2013-07-20 15:35:38 -07:00
Ronnie Sahlberg
0013ae25e6 Merge branch 'master' of github.com:sahlberg/libiscsi 2013-07-20 14:06:05 -07:00
Ronnie Sahlberg
fd38ff4bfc Add MODESENSE6/10 and MODESELECT6/10 support 2013-07-20 14:05:20 -07:00
Ronnie Sahlberg
e556a0399b SCSI MODESELECT: leave the 4/8 byte header completely blank.
The convention is to not fill this header in when sending modeselect to a target
2013-07-20 09:08:52 -07:00
Ronnie Sahlberg
c172e12968 UTILS: Check that an iscsi url was provided on the command line before strdup()ing it 2013-07-20 09:01:38 -07:00
Ronnie Sahlberg
1f958fc7c2 Merge pull request #68 from plieven/iscsi-ls-url
iscsi-ls: add --url parameter
2013-07-18 06:11:26 -07:00
Peter Lieven
bb2aca580c iscsi-ls: add --url parameter
Signed-off-by: Peter Lieven <pl@kamp.de>
2013-07-18 11:33:35 +02:00
Peter Lieven
d429276907 MEMORY introduce a small allocation pool
This patch finally introduces a small allocation pool
which recycles all the small portions of memory that
are used for headers and pdu structures. This was
the initial idea behind wrapping all memory functions
in libiscsi.

The results of booting are test system up to the login
prompt are quite impressive:

BEFORE:
libiscsi:5 memory is clean at iscsi_destroy_context() after 10712 mallocs, 18 realloc(s) and 10712 free(s)

AFTER:
libiscsi:5 memory is clean at iscsi_destroy_context() after 41 mallocs, 18 realloc(s), 41 free(s) and 10584 reused small allocations

Signed-off-by: Peter Lieven <pl@kamp.de>
2013-07-18 11:15:56 +02:00
Ronnie Sahlberg
cc02faabb0 Add TCP_CORK support when available 2013-07-10 14:14:36 -07:00
Ronnie Sahlberg
a3283fbafd TESTS: Add a test that SANITIZE fails when SWP is on. 2013-07-09 02:27:30 -07:00
Ronnie Sahlberg
6e5a5745aa TESTS: Add a test that SANITIZE commands fail when there is a RESERVATION 2013-07-09 01:51:00 -07:00
Ronnie Sahlberg
9e9ca71247 Modesense6 decoding bugs, start preparing for modesense10 decoding 2013-07-08 01:31:03 -07:00
Ronnie Sahlberg
e31e0ce58d TESTS: Log when we skip tests on normal log level, not just for -V 2013-07-08 00:23:39 -07:00
Ronnie Sahlberg
ebb1f06830 Add parameter list length error sense code 2013-07-06 23:35:03 -07:00
Ronnie Sahlberg
a51d706d32 Add invalid field in parameter list sense code 2013-07-06 22:35:36 -07:00
Ronnie Sahlberg
6b93af26a9 Add utility to get/set the software write protect flag 2013-07-06 21:59:03 -07:00
Ronnie Sahlberg
7895fb700c Add MODESELECT6 support
Add support for MODESELECT6 and add marshalling functions for the
mode pages we support so far.
2013-07-06 16:11:17 -07:00
Ronnie Sahlberg
b6e5af558d Unmarshall support for Control modepage 2013-07-05 22:38:45 -07:00
Ronnie Sahlberg
03ce9dc4b1 TESTS: Verify that SANITIZE does wipe the data 2013-07-05 20:15:52 -07:00
Ronnie Sahlberg
b1983aeec1 TESTS: UNMAP make sure we read the blocks back as 0 after unmap 2013-07-05 19:34:56 -07:00
Ronnie Sahlberg
b2e3fc6e6f TESTS: SANITIZE OVERWRITE add tests for OVERWRITE COUNT and INIT PATTERN LEN 2013-07-05 17:41:32 -07:00
Ronnie Sahlberg
705bc27ed5 TESTS: Verify that WACEREQ is 0 if SANITIZE CRYPTO ERASE is not supported 2013-07-05 16:43:28 -07:00
Ronnie Sahlberg
accdad5b1a TESTS: Rename the tests and strip off the redundant prefix for the individual tests
We dont need to repeat the opcode all the time so remove it from the indiviual tests

SCSI.Read10.Read10Simple -> SCSI.Read10.Simple
2013-07-05 16:37:04 -07:00
Ronnie Sahlberg
6a65874dd9 TESTS: Add helper function for READ10 that returns a task* 2013-07-05 16:14:21 -07:00
Ronnie Sahlberg
d8d10c0a44 TESTS: Sanitize check that after block erase all blocks are unmapped 2013-07-05 16:04:29 -07:00
Ronnie Sahlberg
e3a29c0fed TESTS:SANITIZE verify that if BLOCK_ERASE is available we have LBPME==1 2013-07-05 14:52:51 -07:00
Ronnie Sahlberg
3edd40953e TESTS: SANITIZE, Add tests for WABEREQ/WACEREQ 2013-07-05 14:25:43 -07:00
Ronnie Sahlberg
cee82ad135 TESTS: Add tests for the reserved bits/bytes in SANITIZE 2013-07-05 13:32:49 -07:00
Ronnie Sahlberg
3e2729bcfa Merge pull request #66 from bonzini/master
scsi-lowlevel: do not use unsafe pointer casts
2013-07-01 12:42:17 -07:00
Paolo Bonzini
0a7c084603 scsi-lowlevel: do not use unsafe pointer casts
Casting unsigned char * pointers to uint32_t * may cause wrong
results if the pointers are not correctly aligned.  Instead,
build up the big-endian values from each byte with multiple
dereferences of the original pointer.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2013-07-01 16:00:25 +02:00
Ronnie Sahlberg
1ead8d9d28 TESTS: Some targets just discard a command with "unexpected" r/w flags
Set timeout for the read10 invalid test for a read10 with w flag set
and fail the test if we have not received any reply at all within 3 seconds.
2013-06-29 13:49:13 -07:00