From ad6fa9f0d62c689334566047162112c5b86f321a Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 8 Aug 2016 10:14:50 -0700 Subject: [PATCH] iscsi: replace printf()s with spdk/log.h calls Change-Id: Ic2df5a410f5308bf8567058659d518052395fc36 Signed-off-by: Daniel Verkamp --- lib/iscsi/conn.c | 24 +++++++++++++----------- lib/iscsi/iscsi.c | 4 ++-- lib/iscsi/tgt_node.c | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/iscsi/conn.c b/lib/iscsi/conn.c index 316038ac6..2b8f53a54 100644 --- a/lib/iscsi/conn.c +++ b/lib/iscsi/conn.c @@ -610,18 +610,19 @@ spdk_iscsi_drop_conns(struct spdk_iscsi_conn *conn, const char *conn_match, * Only print this message before we report the * first dropped connection. */ - printf("drop old connections %s by %s\n", - conn->target->name, conn_match); + SPDK_ERRLOG("drop old connections %s by %s\n", + conn->target->name, conn_match); } - printf("exiting conn by %s(%s), ", - xconn_match, xconn->initiator_addr); - if (xconn->sess != NULL) - printf("TSIH=%u, ", xconn->sess->tsih); - else - printf("TSIH=xx, "); + SPDK_ERRLOG("exiting conn by %s (%s)", + xconn_match, xconn->initiator_addr); + if (xconn->sess != NULL) { + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "TSIH=%u\n", xconn->sess->tsih); + } else { + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "TSIH=xx\n"); + } - printf("CID=%u\n", xconn->cid); + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "CID=%u\n", xconn->cid); xconn->state = ISCSI_CONN_STATE_EXITING; num++; } @@ -629,8 +630,9 @@ spdk_iscsi_drop_conns(struct spdk_iscsi_conn *conn, const char *conn_match, pthread_mutex_unlock(&g_conns_mutex); - if (num != 0) - printf("exiting %d conns\n", num); + if (num != 0) { + SPDK_ERRLOG("exiting %d conns\n", num); + } return 0; } diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index ea72e3fa4..2f8f373e3 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -957,7 +957,7 @@ spdk_iscsi_auth_params(struct spdk_iscsi_conn *conn, tgtmd5, SPDK_MD5DIGEST_LEN); #if 0 - printf("tgtmd5=%s, resmd5=%s\n", in_val, response); + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "tgtmd5=%s, resmd5=%s\n", in_val, response); spdk_dump("tgtmd5", tgtmd5, SPDK_MD5DIGEST_LEN); spdk_dump("resmd5", resmd5, SPDK_MD5DIGEST_LEN); #endif @@ -4659,7 +4659,7 @@ spdk_append_iscsi_sess(struct spdk_iscsi_conn *conn, return -1; } - printf("Connections(tsih %d): %d\n", sess->tsih, sess->connections); + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "Connections (tsih %d): %d\n", sess->tsih, sess->connections); conn->sess = sess; /* diff --git a/lib/iscsi/tgt_node.c b/lib/iscsi/tgt_node.c index 924fc1ab9..94bab0269 100644 --- a/lib/iscsi/tgt_node.c +++ b/lib/iscsi/tgt_node.c @@ -110,8 +110,8 @@ spdk_iscsi_tgt_node_allow_ipv6(const char *netmask, const char *addr) } #if 0 - printf("input %s\n", addr); - printf("mask %s / %d\n", mask, bits); + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "input %s\n", addr); + SPDK_TRACELOG(SPDK_TRACE_ISCSI, "mask %s / %d\n", mask, bits); #endif /* presentation to network order binary */