Skip to content

Add logout, task management and session controls; free resources - #15

Open
bmeagherix wants to merge 1 commit into
python-scsi:masterfrom
bmeagherix:add_misc
Open

bmeagherix wants to merge 1 commit into
python-scsi:masterfrom
bmeagherix:add_misc

Conversation

@bmeagherix

Copy link
Copy Markdown
Contributor

Add Context.logout(), separate from disconnect(): logout sends an iSCSI Logout and waits for the reply, while disconnect() still just closes the socket, which is useful for simulating an unclean connection drop.

Also expose:

  • abort_task_set(), target_warm_reset(), target_cold_reset()
  • is_logged_in, set_timeout(), set_immediate_data(), set_initial_r2t()
  • set_noautoreconnect(); its prototype is declared locally because it was only added to the public iscsi.h in libiscsi 1.19, although the library has exported it since before 1.13

Include the libiscsi error string (iscsi_get_error) in all exceptions.

Free the iscsi context, SCSI tasks and URLs on deallocation. Destroying a Context does not send a Logout. A URL keeps its Context alive.

Context.command() now raises RuntimeError if the command could not be sent (for example, when not logged in). Before, it failed silently and task.status read as GOOD.

Add Context.logout(), separate from disconnect(): logout sends an iSCSI
Logout and waits for the reply, while disconnect() still just closes the
socket, which is useful for simulating an unclean connection drop.

Also expose:
- abort_task_set(), target_warm_reset(), target_cold_reset()
- is_logged_in, set_timeout(), set_immediate_data(), set_initial_r2t()
- set_noautoreconnect(); its prototype is declared locally because it
  was only added to the public iscsi.h in libiscsi 1.19, although the
  library has exported it since before 1.13

Include the libiscsi error string (iscsi_get_error) in all exceptions.

Free the iscsi context, SCSI tasks and URLs on deallocation. Destroying
a Context does not send a Logout. A URL keeps its Context alive.

Context.command() now raises RuntimeError if the command could not be
sent (for example, when not logged in). Before, it failed silently and
task.status read as GOOD.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant