Add debugging framework

This patch adds a user configurable debug level. For testing
it includes connection info and reporting errors.
This commit is contained in:
Peter Lieven
2012-10-18 10:36:26 +02:00
parent c4592550d6
commit 4cb845477d
9 changed files with 53 additions and 5 deletions

View File

@@ -158,6 +158,8 @@ int iscsi_reconnect(struct iscsi_context *old_iscsi)
{
struct iscsi_context *iscsi = old_iscsi;
DPRINTF(iscsi,2,"reconnect initiated");
/* This is mainly for tests, where we do not want to automatically
reconnect but rather want the commands to fail with an error
if the target drops the session.
@@ -213,6 +215,8 @@ try_again:
iscsi->lun = old_iscsi->lun;
iscsi->portal = strdup(old_iscsi->portal);
iscsi->debug = old_iscsi->debug;
if (iscsi_full_connect_sync(iscsi, iscsi->portal, iscsi->lun) != 0) {
iscsi_destroy_context(iscsi);