When libiscsi is built with clang several spurious
missing-field-initializers warnings like the following are reported:
test_async_write.c:61:45: error: missing field 'completed' initializer
[-Werror,-Wmissing-field-initializers]
struct tests_async_write_state state = { 0 };
These appear to be due to clang being overzealous in its checking
because the code is legal C (see
https://llvm.org/bugs/show_bug.cgi?id=21689 ) but it causes compilation
to be aborted. Workaround the problem by specifying a 0 or NULL for each
structure member.
Dispatch a number of Compare And Write requests simultaneously via
separate iSCSI sessions and await all responses.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Dispatch a number of READ10 requests simultaneously, and await all
responses.
The iscsi-support test helper functions are currently all synchronous,
so this test mostly uses the bare libiscsi API. As new async tests are
added, we can make a more informed decision on which boilerplate code
can be split out.
Signed-off-by: David Disseldorp <ddiss@suse.de>
Ceph RADOS block devices split images into 4MB objects. This test
ensures that cross object IOs are successful.
Signed-off-by: Daniel Oliveira <doliveira@suse.com>
Signed-off-by: David Disseldorp <ddiss@suse.de>
Move the scsi_free_scsi_task() call from receive_copy_results() to the
callers of this function to avoid that accessing the unmarshalled data
triggers a use-after-free.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This patch avoids that Valgrind reports that an uninitialized buffer
is passed to writev():
Syscall param writev(vector[...]) points to uninitialised byte(s)
at 0x5557D07: writev (in /lib64/libc-2.19.so)
by 0x5269BFD: iscsi_iovector_readv_writev (socket.c:509)
by 0x526A7A9: iscsi_write_to_socket (socket.c:727)
by 0x526AE47: iscsi_service (socket.c:888)
by 0x526B632: event_loop (sync.c:67)
by 0x526D925: iscsi_scsi_command_sync (sync.c:1223)
by 0x405970: send_scsi_command (iscsi-support.c:276)
by 0x40B190: extendedcopy (iscsi-support.c:2673)
by 0x40E9FE: test_extendedcopy_param (test_extendedcopy_param.c:63)
by 0x503E260: ??? (in /usr/lib64/libcunit.so.1.0.1)
by 0x503E56E: ??? (in /usr/lib64/libcunit.so.1.0.1)
by 0x503E8A5: CU_run_all_tests (in /usr/lib64/libcunit.so.1.0.1)
Address 0xffefff864 is on thread 1's stack
in frame #8, created by test_extendedcopy_param (test_extendedcopy_param.c:31)
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
The test tool is simplistic and uses the synchronous API. In this API
we will only poll() the socket and process events during the lifetime of any
iscsi_*_sync() calls.
A problem with this approach arises with multipath tests. When iscsi-test-cu
is used with multiple devices we will first open a session for each
multipath leg, but then as most tests are only using the first device we end
up with creating secondary sessions we don't do any iscsi_*_sync() calls on
for very long times. If a target is set up to send NOPs on these
secondary paths it will not get any responses and eventually tear down the
connection.
To avoid this, try to make sure we service any secondary paths we have
created by calling iscsi_service(POLLIN|POLLOUT) every few seconds
to make sure we do service and respond to any NOPs.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Normal applications want the current behaviour where we have the library
consume any/all of the UnitAttentions that the target may have queued on the
initial connection, but when we reconnect the session after a failure the
library will pass all the UAs back to the application to process.
Some applications, such as the test suite or really trivial applications
might not want to have to deal with handling of UAs and just "make it work".
Those applications can now request that upon any reconnection of the session
that libiscsi will automatically consume any and all UAs and hide them from
the application.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>