Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sbin/iscsictl Remove userland side of ISCSI_DEBUG and ISCSI_...
details: https://anonhg.NetBSD.org/src/rev/13f3ff32ebb6
branches: trunk
changeset: 338567:13f3ff32ebb6
user: joerg <joerg%NetBSD.org@localhost>
date: Sat May 30 15:57:32 2015 +0000
description:
Remove userland side of ISCSI_DEBUG and ISCSI_TEST_MODE.
diffstat:
sbin/iscsictl/Makefile | 5 +-
sbin/iscsictl/iscsic_daemonif.c | 23 +-
sbin/iscsictl/iscsic_globals.h | 28 +-
sbin/iscsictl/iscsic_main.c | 34 +-
sbin/iscsictl/iscsic_parse.c | 14 +-
sbin/iscsictl/iscsic_test.c | 1145 ---------------------------------------
6 files changed, 7 insertions(+), 1242 deletions(-)
diffs (truncated from 1447 to 300 lines):
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/Makefile
--- a/sbin/iscsictl/Makefile Sat May 30 15:36:27 2015 +0000
+++ b/sbin/iscsictl/Makefile Sat May 30 15:57:32 2015 +0000
@@ -3,8 +3,7 @@
PROG= iscsictl
BINDIR= /sbin
-SRCS= iscsic_main.c iscsic_driverif.c iscsic_daemonif.c iscsic_parse.c \
- iscsic_test.c
+SRCS= iscsic_main.c iscsic_driverif.c iscsic_daemonif.c iscsic_parse.c
CPPFLAGS+= -I${DESTDIR}/usr/include/dev/iscsi
@@ -14,6 +13,4 @@
MAN= iscsictl.8
-# CPPFLAGS+= -DISCSI_TEST_MODE -DISCSI_DEBUG
-
.include <bsd.prog.mk>
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/iscsic_daemonif.c
--- a/sbin/iscsictl/iscsic_daemonif.c Sat May 30 15:36:27 2015 +0000
+++ b/sbin/iscsictl/iscsic_daemonif.c Sat May 30 15:57:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsic_daemonif.c,v 1.2 2011/10/30 18:40:06 christos Exp $ */
+/* $NetBSD: iscsic_daemonif.c,v 1.3 2015/05/30 15:57:32 joerg Exp $ */
/*-
* Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -1171,24 +1171,3 @@
return 0;
}
-
-
-#ifdef ISCSI_DEBUG
-/*
- * kill_daemon:
- * Handle kill_daemon command.
- *
- * Parameter: argc, argv (shifted)
- *
- * Returns: Always 0.
-*/
-
-int
-kill_daemon(int argc, char **argv)
-{
- check_extra_args(argc, argv);
-
- send_request(ISCSID_DAEMON_TERMINATE, 0, NULL);
- return 0;
-}
-#endif
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/iscsic_globals.h
--- a/sbin/iscsictl/iscsic_globals.h Sat May 30 15:36:27 2015 +0000
+++ b/sbin/iscsictl/iscsic_globals.h Sat May 30 15:57:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsic_globals.h,v 1.4 2011/11/17 16:20:47 joerg Exp $ */
+/* $NetBSD: iscsic_globals.h,v 1.5 2015/05/30 15:57:32 joerg Exp $ */
/*-
* Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -79,26 +79,8 @@
#define min(a,b) ((a < b) ? a : b)
-/* Debugging stuff */
-
-#ifdef ISCSI_DEBUG
-
-int debug_level; /* How much info to display */
-
-#define DEBOUT(x) printf x
-#define DEB(lev,x) {if (debug_level >= lev) printf x ;}
-
#define STATIC static
-#else
-
-#define DEBOUT(x)
-#define DEB(lev,x)
-
-#define STATIC static
-
-#endif
-
/*
* Convert uint64 to 6-byte string in network byte order (for ISID field)
*/
@@ -189,9 +171,6 @@
int list_initiators(int, char **);
int list_sessions(int, char **);
int get_version(int, char **);
-#ifdef ISCSI_DEBUG
-int kill_daemon(int, char **);
-#endif
/* iscsic_driverif.c */
@@ -221,9 +200,4 @@
int cl_get_uint(char, int, char **);
uint64_t cl_get_longlong(char, int, char **);
-#ifdef ISCSI_TEST_MODE
-int test(int, char **);
-#endif
-
-
#endif /* !_ISCSIC_GLOBALS_H */
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/iscsic_main.c
--- a/sbin/iscsictl/iscsic_main.c Sat May 30 15:36:27 2015 +0000
+++ b/sbin/iscsictl/iscsic_main.c Sat May 30 15:57:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsic_main.c,v 1.5 2011/11/20 01:14:17 agc Exp $ */
+/* $NetBSD: iscsic_main.c,v 1.6 2015/05/30 15:57:32 joerg Exp $ */
/*-
* Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -34,7 +34,6 @@
#include <sys/un.h>
#include "iscsic_globals.h"
-#include "iscsi_test.h"
#include <err.h>
#include <errno.h>
@@ -78,12 +77,6 @@
{"list_initiators", list_initiators},
{"list_sessions", list_sessions},
{"set_node_name", set_node_name},
-#ifdef ISCSI_DEBUG
- {"kill_daemon", kill_daemon},
-#endif
-#ifdef ISCSI_TEST_MODE
- {"test", test},
-#endif
{NULL, NULL}
};
@@ -175,16 +168,6 @@
{ISCSID_STATUS_INVALID_INITIATOR_ID, "Initiator ID not found"},
{ISCSID_STATUS_INITIATOR_BIND_ERROR, "Bind to initiator portal failed"},
-#ifdef ISCSI_TEST_MODE
- {ISCSI_STATUS_TEST_INACTIVE, "Test not assigned to connection"},
- {ISCSI_STATUS_TEST_CANCELED, "Test was cancelled"},
- {ISCSI_STATUS_TEST_CONNECTION_CLOSED, "Connection closed"},
- {ISCSI_STATUS_TEST_MODIFICATION_SKIPPED, "Modification skipped due to bad offset"},
- {ISCSI_STATUS_TEST_HEADER_CRC_ERROR, "Received PDU had bad header CRC"},
- {ISCSI_STATUS_TEST_DATA_CRC_ERROR, "Received PDU had bad data CRC"},
- {ISCSI_STATUS_TEST_DATA_READ_ERROR, "Error while receiving PDU"},
-#endif
-
{0, NULL}
};
@@ -205,10 +188,6 @@
int driver; /* driver handle */
-#ifdef ISCSI_DEBUG
-int debug_level = ISCSI_DEBUG; /* How much info to display */
-#endif
-
/* -------------------------------------------------------------------------- */
#define progname getprogname()
@@ -429,8 +408,6 @@
if ((size_t)ret != len)
io_error("Receiving daemon data");
- DEB(9, ("Status %d, parlen %d\n", rsp->status, rsp->parameter_length));
-
len += rsp->parameter_length;
/*
@@ -569,13 +546,8 @@
if (c->cmd == NULL) {
errx(EXIT_FAILURE, "Unknown command: '%s'", cmdname);
}
- if ((driver = open(DEVICE, O_RDONLY)) < 0) {
- warn("Opening " DEVICE);
-#ifndef ISCSI_DEBUG
- /* DEBUG ONLY: Allow CLI to operate w/o driver */
- return EXIT_FAILURE;
-#endif
- }
+ if ((driver = open(DEVICE, O_RDONLY)) < 0)
+ err(EXIT_FAILURE, "Opening " DEVICE);
sock = socket(AF_UNIX, SOCK_DGRAM, 0);
if (sock < 0)
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/iscsic_parse.c
--- a/sbin/iscsictl/iscsic_parse.c Sat May 30 15:36:27 2015 +0000
+++ b/sbin/iscsictl/iscsic_parse.c Sat May 30 15:57:32 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iscsic_parse.c,v 1.2 2011/10/30 18:40:06 christos Exp $ */
+/* $NetBSD: iscsic_parse.c,v 1.3 2015/05/30 15:57:32 joerg Exp $ */
/*-
* Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -262,7 +262,6 @@
}
targ->num_portals = p + 1;
- DEB(9, ("cl_get_target returns %zu\n", len));
return (int)len;
}
@@ -400,7 +399,6 @@
argv[i] = NULL;
found = TRUE;
}
- DEB(9, ("cl_get_auth_opts returns %d\n", found));
return found;
}
@@ -479,7 +477,6 @@
argv[i] = NULL;
found = TRUE;
}
- DEB(9, ("cl_get_target_opts returns %d\n", found));
return found;
}
@@ -552,7 +549,6 @@
argv[i] = NULL;
}
- DEB(9, ("cl_get_portal returns %d\n", found));
return found;
}
@@ -603,7 +599,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_id returns %d\n", found));
return found;
}
@@ -653,7 +648,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_symname returns %d\n", found));
return found;
}
@@ -697,7 +691,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_string returns %d\n", found));
return found;
}
@@ -730,7 +723,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_opt returns %d\n", found));
return found;
}
@@ -777,7 +769,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_charopt returns %c\n", ch));
return ch;
}
@@ -824,7 +815,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_int returns %d\n", val));
return val;
}
@@ -872,7 +862,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_uint returns %d\n", val));
return val;
}
@@ -920,7 +909,6 @@
found = TRUE;
}
}
- DEB(9, ("cl_get_longlong returns %qd\n", val));
return val;
}
diff -r 35e81d80c44e -r 13f3ff32ebb6 sbin/iscsictl/iscsic_test.c
--- a/sbin/iscsictl/iscsic_test.c Sat May 30 15:36:27 2015 +0000
Home |
Main Index |
Thread Index |
Old Index