Only show time stats if clock_gettime(3) is available.
It's actually possible to have clock_gettime(3) and not yet support
CLOCK_MONOTONIC on legacy systems, however on macOS, they all arrived
together in macOS 10.12. Rather than add new configure checks for
CLOCK_MONOTONIC, I opted to use the existing HAVE_CLOCK_GETTIME.
Instead of adding __attribute__((unused)) to unused arguments, add the
-Wno-unused-parameter compiler flag.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Remove a bunch of duplicate code by sharing a function for source and
destination endpoint initialization.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Avoid that building with gcc 7 fails as follows:
iscsi-dd.c: In function 'cscd_ident_inq':
iscsi-dd.c:405:8: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (prev_type <= desig->designator_type) {
^
iscsi-dd.c:409:4: note: here
default:
^~~~~~~
cc1: all warnings being treated as errors
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
EXTENDED COPY can be triggered with the new --xcopy/-x parameter. When
invoked, (--max) EXTENDED COPY requests are dispatched in parallel, with
each request attempting to copy (--blocks) from source to destination.
Signed-off-by: David Disseldorp <ddiss@suse.de>
The variable user in struct iscsi_url is a character array, not a pointer.
Therefore its address will never be NULL.
When libscsi is built using clang instead of gcc, those errors are reported:
iscsi-perf.c:256:17: error:
comparison of array 'iscsi_url->user' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
iscsi-dd.c:272:17: error:
comparison of array 'iscsi_url->user' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
iscsi-dd.c:331:17: error:
comparison of array 'iscsi_url->user' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
ld_iscsi.c:99:18: error:
comparison of array 'iscsi_url->user' not equal to a null
pointer is always true [-Werror,-Wtautological-pointer-compare]
Fix those errors and also similar code patterns in aros/iscsi-ls.c and
test-tool/iscsi-support.c.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
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>
iscsi-dd can be used to copy the content of one iscsi lun onto a different
iscsi lun of the exact same sixe.
This example illustrates how to "steal" a task structure from a callback
so we can use store it and have it remains valid after the read10 callback
has completed.
It also illustrates the async api of libiscsi for read10/write10.
Initially a number of read10 calls are made asynchronously until the
queue is full.
As each read10 completes and returns data, we issue a write10 to write
that data to the other lun.
As soon as a write10 completes, we "release" the initial read10 task corresponding to what we wrote and issue a new read10 to continue copying the next set of un-read data.
Using the async api, it should be easy to get very high performance and
throughput even from one single thread.