Instead of defining the macro _R_(), define __attribute__() as a macro for
compilers that do not support __attribute__(), namely Microsoft Visual
Studio.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Libiscsi supports to parse two iscsi url schemes: 'iscsi://' and 'iser://'.
Fix the missing iser parsing, introduced from 12222077.
Signed-off-by: Han Han <hhan@redhat.com>
Declare dynamically allocated strings as 'char *' instead of 'const char *'.
Remove the discard_const() macro. Do not test whether or not a pointer is
NULL before calling free() because it is allowed to pass NULL to free().
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Using WIN32 depends on the build environment defining the variable.
_WIN32 is a predefined MSVC macro and is always available.
Signed-off-by: Tim Crawford <crawfxrd@gmail.com>
If with int defintion, this statement:
num_blocks = client->num_blocks - client->pos;
May not get the exact value we want.
Signed-off-by: optimistyzy <optimistyzy@gmail.com>
This commit includes all iSER implementation in libscsi
library and utilities.
Also, adding iser option in url.
Change-Id: I55ca8a9d4db802e72eb991061260dbb0bd0ef9ba
Signed-off-by: Roy Shterman <roysh@mellanox.com>
Some iSCSI targets provide a link-local IPv6 address as a portal, but that
is unusable without knowing the interface (aka scope-id) to use for the
connection. This causes iscsi-ls to report an EINVAL and exit. Just
skip the error.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Add ULL to all the large integer literals. Without this they can be
treated as being signed by the compiler (at least on 32 bit machines)
leading to underflow problems and strange output when calculating the
elapsed time.
7c6a3e4a0b wound up always forcing the
usage of gettimeofday (even when the more accurate CLOCK_MONOTONIC was
available) because the define to indicate its availability is in
config.h which wasn't included.
Fix this by including config.h, correct the misnamed variable in the
CLOCK_MONOTONIC branch and rename VERSION to PERF_VERSION to avoid the
naming conflict.
this adds a switch to define max_reconnects instead of just aborting
after a NOP timeout. It is now also possible to force an exit
if CTRL-C is pressed twice.
Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi-ls show luns command does not work when the target redirects at login.
to avoid redundant code allow iscsi_full_connect_async to skip the testunit ready
part.
Signed-off-by: Peter Lieven <pl@kamp.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>
Compiling with clang gives a format warning like
iscsi-perf.c:98:53: error: format specifies type 'unsigned long' but the
argument has type 'uint64_t' (aka 'unsigned long long')
[-Werror,-Wformat]
so replace %lu with %llu where appropriate.
Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
A quote from SPC-4: "When using the MODE SENSE command, a
parameters saveable (PS) bit set to one indicates that the mode
page may be saved by the logical unit in a nonvolatile, vendor
specific location. A PS bit set to zero indicates that the device
server is not able to save the supported parameters. When using
the MODE SELECT command, the PS bit is reserved."
Hence clear the PS bit after having queried a mode page via MODE
SENSE and before changing it via MODE SELECT.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>