The following used to fail:
./configure --prefix=/tmp/libiscsi
make install
This was because DESTDIR was unconditionally used in Makefile.in.
Instead, use the prefix from ./configure unless overriden by DESTDIR
and/or LIBDIR.
Note that this commit drops ldconfig from the Makefile but I'm not sure
this is wanted outside of packaging anyway.
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
between them makes compilers complain about aliasing.
Merge the two and use one single structure bot both iscsi and scsi sync
commands so that gcc stops crying about strict-aliasing
ld_iscsi.so is a small LD_PRELOAD hack that can be used to make normal
unix utilities such as 'stat' and 'cat' become iSCSI 'aware' and fake
handling an iSCSI URL as a normal read-only file.
See README for examples.
are in flight at the moment.
Aside from commands, we also consider the "has not yet connected completely" as being an i/o.
When this command returns 0 it means we are connected ant the iscsi connection is idle, with no commands in flight.
KVM needs a function to detect idleness like this for its block layer io_flush
function.
"random" ISID randomly.
Dont assume that users will never create multiple contexts
concurrently, in which case the previous getpid()^time(NULL)
would create duplicates.
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.
LBA is uint32_t for read/write10
Also store the lba/numblocks arguments in the task structure for read10/write10
This makes it much easier to implement a fully async "read lots/write lots"
applications.
A Portal URL is of the form
iscsi://[<username>[%<password>]@]<host>[:<port>]
and is used by command such as iscsi-ls during the discovery login phase.
During discovery we do not yet know the target iqn name, nor the lun of
any devices.
There is no point in setting the username if there is no password
and vice versa.
Also, if we only set username but not passwd this would lead to a segv.
so that the password will not be showing up in log where the application
logs the "filename/iscsi url" or in ps aux output.
LIBISCSI_CHAP_USERNAME and LIBISCSI_CHAP_PASSWORD environment variables are
available to set these outside of the url.
If hte username/password is ALSO set in the URL, the settings in the URL
will override the environment variables.