From c2836e2a9aea67ec14360260c2e031ba8f57f8a3 Mon Sep 17 00:00:00 2001 From: Peter Lieven Date: Tue, 23 Oct 2012 10:53:14 +0200 Subject: [PATCH] DPRINTF add iscsi target_name if available This patch adds the iscsi target name to the debug output --- include/iscsi.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/iscsi.h b/include/iscsi.h index 30aa5ea..cae57f3 100644 --- a/include/iscsi.h +++ b/include/iscsi.h @@ -959,7 +959,17 @@ iscsi_scsi_task_cancel(struct iscsi_context *iscsi, EXTERN void iscsi_scsi_cancel_all_tasks(struct iscsi_context *iscsi); -#define DPRINTF(iscsi,level,fmt,args...) do { if ((iscsi)->debug >= level) {fprintf(stderr,"libiscsi: ");fprintf(stderr, (fmt), ##args); fprintf(stderr,"\n");} } while (0); +#define DPRINTF(iscsi,level,fmt,args...) \ + do { \ + if ((iscsi)->debug >= level) { \ + fprintf(stderr,"libiscsi: "); \ + fprintf(stderr, (fmt), ##args); \ + if (iscsi->target_name) { \ + fprintf(stderr," [%s]",iscsi->target_name); \ + } \ + fprintf(stderr,"\n"); \ + } \ + } while (0); /* * This function is to set the debugging level (0=disabled).