Commit Graph

651 Commits

Author SHA1 Message Date
Peter Lieven
f2f42547bd ISCSI fix leaked memory report
As long as we have no struct iscsi_task we cannot track the
free() of data.indata buffer. This leads to a leaked memory
report in iscsi_context_destroy().

We fix this by assuming it has been freed when we pass it
it to scsi_task.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-11-23 16:37:56 +01:00
Ronnie Sahlberg
4a973e9a4e SCSI: Pass the expected opcode to scsi_cdb_unmarshall()
Pass the opcode we expect to the unmarshalling function so it can do a basic
check that we are trying to unmarshalling the right kind of cdb.
2012-11-20 19:16:42 -08:00
Ronnie Sahlberg
890471c8cc Add support to unmarshall a CDB into a structure and update iscsi-dd
Add two new helper functions scsi_get_uint32() and scsi_get_uint16()
2012-11-20 19:00:55 -08:00
Ronnie Sahlberg
e691f9cc2b ISCSI-DD: Remove some compiler warnings 2012-11-20 06:49:19 -08:00
Ronnie Sahlberg
3b3036b9da Add support for SCSI Sense formats 0x72/0x73 2012-11-19 18:25:12 -08:00
Ronnie Sahlberg
b4746678f9 Merge pull request #38 from aredlich/master
Remove scsi_task->params
2012-11-19 18:19:28 -08:00
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
Bernhard Kohl
219533dc7b Returned buffers from poptGetArgs() are free()ed in poptFreeContext()
Calling "free(url);" causes a core dump in glibc-2.15.

Signed-off-by: Bernhard Kohl <bernhard.kohl@gmx.net>
2012-11-18 14:12:30 -08:00
Peter Lieven
a75727d989 RECONNECT avoid deadlock on reconnect retry timeout
If there is a clock jump e.g. due to daylight saving time
the wait can be almost infinite
2012-11-18 14:03:13 -08:00
Peter Lieven
328755fb68 CONNECT add further debug output regardint login and reconnect 2012-11-18 14:02:29 -08:00
Peter Lieven
9e05aecadd MEMORY further remove memory reallocations
added a few tweaks to further remove the need to memory
allocation resizing by preallocating the right buffer size.

Signed-off-by: Peter Lieven <pl@kamp.de>
2012-11-18 14:01:52 -08:00
Peter Lieven
30804507f9 SYNC set status to -1 on error in event_loop
If there is an error in iscsi_service or on poll we
exit the event_loop. But in this case scsi_sync_cb is
never reached and the status is 0. This will make
the caller think that the sync task has been completed
successfully.
2012-11-18 14:00:31 -08:00
Peter Lieven
577d37c5ed RECONNECT exit from sync event_loop in case of an error
If there is an error during reconnect we should not loop in event_loop
as this will cause a deadlock in case there is actually an error like
connection drop etc. If this reconnect fails the reconnect routine
will retry itself.
2012-11-18 13:59:53 -08: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
Peter Lieven
f9dc2da672 Revert "CONNECT only read/write from sockets when connection is established"
Fixed the login process in qemu-kvm. This makes this fix obsolete.

This reverts commit a9257d52a7.
2012-11-18 13:57:57 -08:00
Peter Lieven
00baa9bd6c CONNECT fixed memleak in case iscsi_connect_async fails directly 2012-11-18 13:57:02 -08:00
Ronnie Sahlberg
bdfa2833e5 tiny style change 2012-11-18 13:55:15 -08:00
Peter Lieven
6f3a575238 INIT check iscsi==NULL in iscsi_get_error()
qemu-kvm calls iscsi_get_error(NULL) if we specify an invalid URL
2012-11-18 13:54:07 -08:00
Peter Lieven
6f7b02989a LOGGING log target_name and not initator_name 2012-11-18 13:52:55 -08:00
Peter Lieven
bd1d5ec70f LOGGING add target name to log output 2012-11-18 13:52:48 -08: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
Ronnie Sahlberg
3ccc2f2834 TESTS: Update the VERIFY10/12/16 tests for BYTCHK==0 2012-11-18 10:10:04 -08:00
Ronnie Sahlberg
f9767e729a VERIFY10/12/16 If BYTCHK is false we dont need to transfer any blocks to the target
If BYTCHK is false the target will perform a medium check of the indicated
LBAs only and not compare with anything out of the DATA-OUT buffers.
As such we dont need to/should not transfer any DAT-OUT to the target.
2012-11-18 09:46:51 -08: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
Ronnie Sahlberg
e661c22875 Merge pull request #36 from plieven/master
Merge of my patches as discussed
2012-11-12 16:44:18 -08: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
736e175e83 Build with -Werror 2012-11-11 10:15:52 -08:00