Commit Graph

169 Commits

Author SHA1 Message Date
Arne Redlich
5194d13e73 scsi-lowlevel: remove scsi_maintenancein_params and finally scsi_task->params too
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 23:28:32 +01:00
Arne Redlich
8baa843d73 scsi-lowlevel: remove scsi_readtoc_params and fix READ TOC format field
Set the format field in the READ TOC CDB (lower nibble of byte 2).

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 23:16:45 +01:00
Arne Redlich
551298adfb scsi-lowlevel: remove scsi_serviceactionin_params and plug potential memleaks
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 22:57:59 +01:00
Arne Redlich
fa158865d2 scsi-lowlevel: remove scsi_modesense6_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 22:47:14 +01:00
Arne Redlich
5f414317dc scsi-lowlevel: remove scsi_inquiry_params and refactor INQUIRY data-in unmarshalling
Split the INQUIRY data-in unmarshalling into smaller chunks, fixing some
potential memory leaks along the way.

Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 22:46:04 +01:00
Arne Redlich
b5a9ba6159 scsi-lowlevel: remove scsi_readcapacity10_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 22:04:57 +01:00
Arne Redlich
188505a72d scsi-lowlevel: remove scsi_verify16_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:59:42 +01:00
Arne Redlich
de67d86e64 scsi-lowlevel: remove scsi_verify12_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:58:30 +01:00
Arne Redlich
10fd2f560b scsi-lowlevel: remove scsi_verify10_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:57:00 +01:00
Arne Redlich
1dbdd04795 scsi-lowlevel: remove scsi_writeverify16_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:55:01 +01:00
Arne Redlich
a262d07c4b scsi-lowlevel: remove scsi_writeverify12_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:53:44 +01:00
Arne Redlich
fff2527cda scsi-lowlevel: remove scsi_writeverify10_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:52:34 +01:00
Arne Redlich
8169c3e280 scsi-lowlevel: remove scsi_compareandwrite_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:51:10 +01:00
Arne Redlich
9f7f7f1e0d scsi-lowlevel: remove scsi_orwrite_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:48:17 +01:00
Arne Redlich
8f513c23f5 scsi-lowlevel: remove scsi_preventallow_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:46:52 +01:00
Arne Redlich
a02cd53cfc scsi-lowlevel: remove scsi_startstopunit_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:45:02 +01:00
Arne Redlich
3ec1a2147f scsi-lowlevel: remove scsi_write16_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:43:15 +01:00
Arne Redlich
f95d86f762 scsi-lowlevel: remove scsi_write12_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:41:53 +01:00
Arne Redlich
1ca5f447fc scsi-lowlevel: remove scsi_write10_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:40:27 +01:00
Arne Redlich
daed6117c8 scsi-lowlevel: remove scsi_read16_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:38:35 +01:00
Arne Redlich
17eff2d8d9 scsi-lowlevel: remove scsi_read12_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:37:05 +01:00
Arne Redlich
f955449ecc scsi-lowlevel: remove scsi_read10_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:35:37 +01:00
Arne Redlich
d95e811ccf scsi-lowlevel: remove scsi_read6_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:34:08 +01:00
Arne Redlich
76aa2693c4 scsi-lowlevel: remove scsi_reportluns_params
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 21:31:11 +01:00
Arne Redlich
44cb5d60c5 iscsi.h: include <sys/types.h> as iscsi_data gained a size_t member
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-18 00:36:28 +01:00
Peter Lieven
b1374b42ed Rename scsi-command.c to iscsi-command.c 2012-11-12 16:12:29 +01:00
Peter Lieven
8cb369b87f Merge remote-tracking branch 'upstream-git/master'
Conflicts:
	include/iscsi-private.h
	include/iscsi.h
	lib/connect.c
	lib/init.c
	lib/scsi-lowlevel.c
2012-11-12 16:02:57 +01:00
Peter Lieven
5e1d011270 SCSI-LOWLEVEL revert changes to scsi-lowlevel
The memory tracking code reports memory allocated by iscsi_allocate_pdu_with_itt_flags_size() as lost.
This memory is allocated by the iscsi part of libiscsi, but later freed by the lowlevel scsi part. We
will fix this later by introducing an iscsi_task object.
2012-11-12 15:43:29 +01:00
Ronnie Sahlberg
a5b8224f4e Dont include iscsi headers from the scsi implementation in scsi-lowlevel.c 2012-11-11 09:49:49 -08:00
Ronnie Sahlberg
3b05e9996f Move cancel_task and cancel_all_tasks from scsi-lowlevel.c to scsi-command.c
These two functions belong in the iscsi layer, not the scsi layer so move them
out from scsi-lowlevel.c so that we can start turning scsi-lowlevel.c to a pure
scsi layer and remove all dependencies to iscsi from it.
2012-11-11 09:44:11 -08:00
Ronnie Sahlberg
4de36794f2 Make scsi_allocated_memory private to scsi-lowlevel and remove the ptr pointer
Change the list-head structure for in-task scsi memory allocations to
be private to scsi-lowlevel since is is never accessed from anyehwere else and
it is private to this function.
Remove the pointer to the user data in the list head and replace it with a zero length buffer at the end of the header.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2012-11-11 08:07:26 -08:00
Peter Lieven
144026a7bd RECONNECT allow a consecutive reconnect only every 5 seconds
In case there is an error condition e.g. out of memory. We are heavily
disconnecting and reconnecting without any limit. This patch
adds a 5 seconds period that has to go by between 2 reconnects.
2012-11-08 16:56:44 +01:00
Ronnie Sahlberg
50e7c682bb Add a logging subsystem and change all DPRINTF to ISCSI_LOG
Add a mechanism where we can set a logging subsystem that libiscsi can use.
Create an example 'log to stderr' that utilities can use for convenience.
2012-11-07 06:34:38 -08:00
Peter Lieven
a97b51bbe5 Revert "DEBUG add function to set debug fd"
We will have a completely different debugging framework soon.

This reverts commit ec46d6fa43.
2012-11-07 06:45:54 +01:00
Peter Lieven
ec46d6fa43 DEBUG add function to set debug fd
DPRINTF was blindly sending all debug output to fd 2 (stderr).
The new function iscsi_set_debug_fd() will set the debug fd.
In general debugging is completely disabled by default.
2012-11-06 16:07:43 +01:00
Peter Lieven
3e57a612db SOCKET add more skill to interface binding
If a process opens more than once connection the interfaces are assigned
round-robin from the available ones. However, different processes will
uses a random interface of as starting point. This patch will also
make the redirect case handled correctly.
2012-11-06 15:47:30 +01:00
Peter Lieven
6cad82532a SOCKET add option to bind to connection to interface(s) 2012-11-06 14:53:55 +01:00
Peter Lieven
e6553c2ef8 MEMORY account reallocs 2012-11-05 15:20:15 +01:00
Peter Lieven
65cd38e8ff PDU further optimize iscsi_add_data()
This patch further improves add data and esepcially preassigns
the right amount of memory where the amount is preknown
2012-11-05 15:13:50 +01:00
Peter Lieven
36527c5122 Merge remote-tracking branch 'aredlich/master'
Conflicts:
	lib/init.c
	lib/socket.c
2012-11-03 10:39:23 +01:00
Peter Lieven
c4dc380262 PDU reduce number of mallocs/memcpys in iscsi_add_data()
This patch adds logarithmic malloc behaviour to iscsi_add_data().
Currently for each new call there is a new buffer allocated
and all old data is copied to the new buffer. Change this by
allocating at least PAGE_SIZE bytes and increase the allocation
by powers of 2 each time it does no longer fit.
2012-11-03 02:49:56 +01:00
Peter Lieven
d9fbe37f4b HEADERS fix early commit of new header data 2012-11-03 02:28:23 +01:00
Peter Lieven
3268ae4c88 INIT fix iscsi_destroy_url 2012-11-03 02:26:30 +01:00
Peter Lieven
d327ab09c6 MEMORY add wrappers around all mallocs and frees and trace them
This patch adds a wrapper around all memory allocations and frees.
The idea is to get warned immediately if the application leaks memory.
Additionally the wrapper functions make it easy to add different
memory allocators or memory pools in the future.
2012-11-03 01:05:57 +01:00
Arne Redlich
0bf9b6389c Annotate iscsi_set_error with printf format attribute
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
2012-11-02 21:11:30 +01:00
Peter Lieven
820410526e INIT fix missing export of iscsi_set_tcp_syncnt() 2012-10-30 12:05:25 +01:00
Peter Lieven
774ede1f46 ISCSI_URL change strings from dynamic to static 2012-10-30 11:41:51 +01:00
Peter Lieven
923b9a4fb2 ISCSI-CONTEXT change dynamic string allocations to statics 2012-10-27 17:23:40 +02:00
Peter Lieven
48e55669e3 SLIST add function to debug length 2012-10-26 18:10:26 +02:00
Peter Lieven
4e7bd8767b DPRINTF explain debug levels 2012-10-26 08:43:47 +02:00