This commit is contained in:
parent
d4d8c366be
commit
a3c1930c25
@ -1,97 +1,7 @@
|
||||
diff --git a/Makefile b/Makefile
|
||||
index db460eb..a4d4ce0 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -32,6 +32,7 @@ user: ;
|
||||
$(MAKE) -C utils/fwparam_ibft
|
||||
$(MAKE) -C usr
|
||||
$(MAKE) -C utils
|
||||
+ $(MAKE) -C libiscsi
|
||||
@echo
|
||||
@echo "Compilation complete Output file"
|
||||
@echo "----------------------------------- ----------------"
|
||||
@@ -53,6 +54,7 @@ kernel: force
|
||||
force: ;
|
||||
|
||||
clean:
|
||||
+ $(MAKE) -C libiscsi clean
|
||||
$(MAKE) -C utils/sysdeps clean
|
||||
$(MAKE) -C utils/fwparam_ibft clean
|
||||
$(MAKE) -C utils clean
|
||||
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
|
||||
new file mode 100644
|
||||
index 0000000..4aeb44f
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/Makefile
|
||||
@@ -0,0 +1,62 @@
|
||||
+# This Makefile will work only with GNU make.
|
||||
+
|
||||
+OSNAME=$(shell uname -s)
|
||||
+OPTFLAGS ?= -O2 -g
|
||||
+WARNFLAGS ?= -Wall -Wstrict-prototypes
|
||||
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -I../utils/open-isns \
|
||||
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
|
||||
+LIB = libiscsi.so.0
|
||||
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
|
||||
+TESTS += tests/test_login tests/test_logout tests/test_params
|
||||
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
|
||||
+TESTS += tests/test_set_auth tests/test_get_auth
|
||||
+
|
||||
+COMMON_SRCS = sysdeps.o
|
||||
+# sources shared between iscsid, iscsiadm and iscsistart
|
||||
+ISCSI_LIB_SRCS = session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
|
||||
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
|
||||
+
|
||||
+# sources shared with the userspace utils, note we build these separately
|
||||
+# to get PIC versions.
|
||||
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
|
||||
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
|
||||
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
|
||||
+
|
||||
+# Flags for the tests
|
||||
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
|
||||
+
|
||||
+all: lib tests html
|
||||
+
|
||||
+lib: $(LIB)
|
||||
+tests: $(TESTS)
|
||||
+
|
||||
+common-objs/%.o: ../utils/sysdeps/%.c
|
||||
+ mkdir -p common-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+usr-objs/%.o: ../usr/%.c
|
||||
+ mkdir -p usr-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
||||
+ mkdir -p fw-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
|
||||
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -shared -Wl,-soname,$(LIB) $^ -o $@
|
||||
+ ln -s -f $(LIB) libiscsi.so
|
||||
+
|
||||
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
|
||||
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -c $< -o $@
|
||||
+
|
||||
+html: libiscsi.h libiscsi.doxy
|
||||
+ doxygen libiscsi.doxy
|
||||
+
|
||||
+clean:
|
||||
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
|
||||
+ .depend *~ html $(TESTS) tests/*~
|
||||
+
|
||||
+depend:
|
||||
+ gcc $(CFLAGS) -M `ls *.c` > .depend
|
||||
+
|
||||
+-include .depend ../usr/.depend
|
||||
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
|
||||
new file mode 100644
|
||||
index 0000000..a9eb0a6
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/libiscsi.c
|
||||
@@ -0,0 +1,563 @@
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c 2011-01-31 03:00:37.000000000 -0600
|
||||
@@ -0,0 +1,580 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
+ *
|
||||
@ -131,9 +41,13 @@ index 0000000..a9eb0a6
|
||||
+#include "iscsi_proto.h"
|
||||
+#include "fw_context.h"
|
||||
+#include "iscsid_req.h"
|
||||
+#include "iscsi_err.h"
|
||||
+
|
||||
+#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
|
||||
+
|
||||
+/* UGLY, not thread safe :( */
|
||||
+static int sysfs_initialized = 0;
|
||||
+
|
||||
+struct libiscsi_context {
|
||||
+ char error_str[256];
|
||||
+ /* For get_parameter_helper() */
|
||||
@ -160,7 +74,10 @@ index 0000000..a9eb0a6
|
||||
+ return NULL;
|
||||
+
|
||||
+ log_init("libiscsi", 1024, libiscsi_log, context);
|
||||
+ sysfs_init();
|
||||
+ if (!sysfs_initialized) {
|
||||
+ sysfs_init();
|
||||
+ sysfs_initialized = 1;
|
||||
+ }
|
||||
+ increase_max_files();
|
||||
+ if (idbm_init(NULL)) {
|
||||
+ sysfs_cleanup();
|
||||
@ -467,7 +384,7 @@ index 0000000..a9eb0a6
|
||||
+{
|
||||
+ int rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
|
||||
+ if (rc) {
|
||||
+ iscsid_handle_error(rc);
|
||||
+ iscsi_err_print_msg(rc);
|
||||
+ rc = ENOTCONN;
|
||||
+ }
|
||||
+ return rc;
|
||||
@ -501,7 +418,7 @@ index 0000000..a9eb0a6
|
||||
+
|
||||
+ rc = iscsid_req_by_sid(MGMT_IPC_SESSION_LOGOUT, info->sid);
|
||||
+ if (rc) {
|
||||
+ iscsid_handle_error(rc);
|
||||
+ iscsi_err_print_msg(rc);
|
||||
+ rc = EIO;
|
||||
+ }
|
||||
+
|
||||
@ -623,6 +540,11 @@ index 0000000..a9eb0a6
|
||||
+{
|
||||
+ struct boot_context fw_entry;
|
||||
+
|
||||
+ if (!sysfs_initialized) {
|
||||
+ sysfs_init();
|
||||
+ sysfs_initialized = 1;
|
||||
+ }
|
||||
+
|
||||
+ memset(config, 0, sizeof *config);
|
||||
+ memset(&fw_entry, 0, sizeof fw_entry);
|
||||
+ if (fw_get_entry(&fw_entry))
|
||||
@ -645,6 +567,11 @@ index 0000000..a9eb0a6
|
||||
+{
|
||||
+ struct boot_context fw_entry;
|
||||
+
|
||||
+ if (!sysfs_initialized) {
|
||||
+ sysfs_init();
|
||||
+ sysfs_initialized = 1;
|
||||
+ }
|
||||
+
|
||||
+ memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
|
||||
+ memset(&fw_entry, 0, sizeof fw_entry);
|
||||
+ if (fw_get_entry(&fw_entry))
|
||||
@ -655,11 +582,9 @@ index 0000000..a9eb0a6
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/libiscsi/libiscsi.doxy b/libiscsi/libiscsi.doxy
|
||||
new file mode 100644
|
||||
index 0000000..663770f
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/libiscsi.doxy
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.doxy 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,1473 @@
|
||||
+# Doxyfile 1.5.7.1
|
||||
+
|
||||
@ -2134,11 +2059,9 @@ index 0000000..663770f
|
||||
+# used. If set to NO the values of all tags below this one will be ignored.
|
||||
+
|
||||
+SEARCHENGINE = NO
|
||||
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h
|
||||
new file mode 100644
|
||||
index 0000000..a7d05a5
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/libiscsi.h
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/libiscsi.h 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,343 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -2483,11 +2406,74 @@ index 0000000..a7d05a5
|
||||
+#endif /* __cplusplus */
|
||||
+
|
||||
+#endif
|
||||
diff --git a/libiscsi/pylibiscsi.c b/libiscsi/pylibiscsi.c
|
||||
new file mode 100644
|
||||
index 0000000..454a26a
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/pylibiscsi.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2011-01-31 03:03:47.000000000 -0600
|
||||
@@ -0,0 +1,61 @@
|
||||
+# This Makefile will work only with GNU make.
|
||||
+
|
||||
+OSNAME=$(shell uname -s)
|
||||
+OPTFLAGS ?= -O2 -g
|
||||
+WARNFLAGS ?= -Wall -Wstrict-prototypes
|
||||
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \
|
||||
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
|
||||
+LIB = libiscsi.so.0
|
||||
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
|
||||
+TESTS += tests/test_login tests/test_logout tests/test_params
|
||||
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
|
||||
+TESTS += tests/test_set_auth tests/test_get_auth
|
||||
+
|
||||
+COMMON_SRCS = sysdeps.o
|
||||
+# sources shared between iscsid, iscsiadm and iscsistart
|
||||
+ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
|
||||
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
|
||||
+
|
||||
+# sources shared with the userspace utils, note we build these separately
|
||||
+# to get PIC versions.
|
||||
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
|
||||
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
|
||||
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
|
||||
+
|
||||
+# Flags for the tests
|
||||
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
|
||||
+
|
||||
+all: lib tests html
|
||||
+
|
||||
+lib: $(LIB)
|
||||
+tests: $(TESTS)
|
||||
+
|
||||
+common-objs/%.o: ../utils/sysdeps/%.c
|
||||
+ mkdir -p common-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+usr-objs/%.o: ../usr/%.c
|
||||
+ mkdir -p usr-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
||||
+ mkdir -p fw-objs
|
||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||
+
|
||||
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
|
||||
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@
|
||||
+ ln -s -f $(LIB) libiscsi.so
|
||||
+
|
||||
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
|
||||
+
|
||||
+html: libiscsi.h libiscsi.doxy
|
||||
+ doxygen libiscsi.doxy
|
||||
+
|
||||
+clean:
|
||||
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
|
||||
+ .depend *~ html $(TESTS) tests/*~
|
||||
+
|
||||
+depend:
|
||||
+ gcc $(CFLAGS) -M `ls *.c` > .depend
|
||||
+
|
||||
+-include .depend ../usr/.depend
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/pylibiscsi.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,624 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3113,11 +3099,9 @@ index 0000000..454a26a
|
||||
+ Py_INCREF(&PyIscsiNode_Type);
|
||||
+ PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type);
|
||||
+}
|
||||
diff --git a/libiscsi/setup.py b/libiscsi/setup.py
|
||||
new file mode 100644
|
||||
index 0000000..bb4329b
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/setup.py
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/setup.py 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,9 @@
|
||||
+from distutils.core import setup, Extension
|
||||
+
|
||||
@ -3128,11 +3112,9 @@ index 0000000..bb4329b
|
||||
+
|
||||
+setup (name = 'PyIscsi',version = '1.0',
|
||||
+ description = 'libiscsi python bindings', ext_modules = [module1])
|
||||
diff --git a/libiscsi/tests/test_discovery_firmware.c b/libiscsi/tests/test_discovery_firmware.c
|
||||
new file mode 100644
|
||||
index 0000000..76e852a
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_discovery_firmware.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_firmware.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,53 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3187,11 +3169,9 @@ index 0000000..76e852a
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_discovery_sendtargets.c b/libiscsi/tests/test_discovery_sendtargets.c
|
||||
new file mode 100644
|
||||
index 0000000..1a3c12e
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_discovery_sendtargets.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_discovery_sendtargets.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,60 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3253,11 +3233,9 @@ index 0000000..1a3c12e
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_get_auth.c b/libiscsi/tests/test_get_auth.c
|
||||
new file mode 100644
|
||||
index 0000000..5e234da
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_get_auth.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_auth.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,70 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3329,11 +3307,9 @@ index 0000000..5e234da
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_get_initiator_name.c b/libiscsi/tests/test_get_initiator_name.c
|
||||
new file mode 100644
|
||||
index 0000000..997c053
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_get_initiator_name.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_initiator_name.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,38 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3373,11 +3349,9 @@ index 0000000..997c053
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_get_network_config.c b/libiscsi/tests/test_get_network_config.c
|
||||
new file mode 100644
|
||||
index 0000000..2dedd61
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_get_network_config.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_get_network_config.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,45 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3424,11 +3398,9 @@ index 0000000..2dedd61
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_login.c b/libiscsi/tests/test_login.c
|
||||
new file mode 100644
|
||||
index 0000000..3eb70d6
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_login.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_login.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,52 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3482,11 +3454,9 @@ index 0000000..3eb70d6
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_logout.c b/libiscsi/tests/test_logout.c
|
||||
new file mode 100644
|
||||
index 0000000..b734dca
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_logout.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_logout.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,51 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3539,11 +3509,9 @@ index 0000000..b734dca
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_params.c b/libiscsi/tests/test_params.c
|
||||
new file mode 100644
|
||||
index 0000000..d3223be
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_params.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_params.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,103 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3648,11 +3616,9 @@ index 0000000..d3223be
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/libiscsi/tests/test_set_auth.c b/libiscsi/tests/test_set_auth.c
|
||||
new file mode 100644
|
||||
index 0000000..a21f888
|
||||
--- /dev/null
|
||||
+++ b/libiscsi/tests/test_set_auth.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/tests/test_set_auth.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -0,0 +1,58 @@
|
||||
+/*
|
||||
+ * iSCSI Administration library
|
||||
@ -3712,10 +3678,28 @@ index 0000000..a21f888
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
diff --git a/usr/discovery.c b/usr/discovery.c
|
||||
index 381f825..2233de7 100644
|
||||
--- a/usr/discovery.c
|
||||
+++ b/usr/discovery.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/Makefile 2011-01-31 02:35:12.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -32,6 +32,7 @@ user: ;
|
||||
$(MAKE) -C utils/fwparam_ibft
|
||||
$(MAKE) -C usr
|
||||
$(MAKE) -C utils
|
||||
+ $(MAKE) -C libiscsi
|
||||
@echo
|
||||
@echo "Compilation complete Output file"
|
||||
@echo "----------------------------------- ----------------"
|
||||
@@ -53,6 +54,7 @@ kernel: force
|
||||
force: ;
|
||||
|
||||
clean:
|
||||
+ $(MAKE) -C libiscsi clean
|
||||
$(MAKE) -C utils/sysdeps clean
|
||||
$(MAKE) -C utils/fwparam_ibft clean
|
||||
$(MAKE) -C utils clean
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/discovery.c 2011-01-31 02:35:13.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c 2011-01-31 02:57:55.000000000 -0600
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "types.h"
|
||||
#include "iscsi_proto.h"
|
||||
@ -3724,14 +3708,82 @@ index 381f825..2233de7 100644
|
||||
#include "log.h"
|
||||
#include "idbm.h"
|
||||
#include "iscsi_settings.h"
|
||||
diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h
|
||||
index 74ef948..713914f 100644
|
||||
--- a/usr/iscsi_ipc.h
|
||||
+++ b/usr/iscsi_ipc.h
|
||||
@@ -111,4 +111,6 @@ struct iscsi_ipc {
|
||||
@@ -50,9 +51,11 @@
|
||||
#include "iscsi_timer.h"
|
||||
#include "iscsi_err.h"
|
||||
/* libisns includes */
|
||||
+#ifdef ISNS_ENABLE
|
||||
#include "isns.h"
|
||||
#include "paths.h"
|
||||
#include "message.h"
|
||||
+#endif
|
||||
|
||||
#ifdef SLP_ENABLE
|
||||
#include "iscsi-slp-discovery.h"
|
||||
@@ -98,6 +101,7 @@ static int request_initiator_name(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef ISNS_ENABLE
|
||||
void discovery_isns_free_servername(void)
|
||||
{
|
||||
if (isns_config.ic_server_name)
|
||||
@@ -371,6 +375,7 @@ retry:
|
||||
discovery_isns_free_servername();
|
||||
return rc;
|
||||
}
|
||||
+#endif
|
||||
|
||||
int discovery_fw(void *data, struct iface_rec *iface,
|
||||
struct list_head *rec_list)
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c 2011-01-31 02:35:13.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c 2011-01-31 02:47:52.000000000 -0600
|
||||
@@ -1214,9 +1214,9 @@ int idbm_print_all_discovery(int info_le
|
||||
* fn should return -1 if it skipped the rec, a ISCSI_ERR error code if
|
||||
* the operation failed or 0 if fn was run successfully.
|
||||
*/
|
||||
-static int idbm_for_each_iface(int *found, void *data,
|
||||
- idbm_iface_op_fn *fn,
|
||||
- char *targetname, int tpgt, char *ip, int port)
|
||||
+int idbm_for_each_iface(int *found, void *data,
|
||||
+ idbm_iface_op_fn *fn,
|
||||
+ char *targetname, int tpgt, char *ip, int port)
|
||||
{
|
||||
DIR *iface_dirfd;
|
||||
struct dirent *iface_dent;
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h 2011-01-31 02:35:13.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h 2011-01-31 02:48:39.000000000 -0600
|
||||
@@ -96,6 +96,9 @@ struct rec_op_data {
|
||||
node_rec_t *match_rec;
|
||||
idbm_iface_op_fn *fn;
|
||||
};
|
||||
+extern int idbm_for_each_iface(int *found, void *data,
|
||||
+ idbm_iface_op_fn *fn,
|
||||
+ char *targetname, int tpgt, char *ip, int port);
|
||||
extern int idbm_for_each_portal(int *found, void *data,
|
||||
idbm_portal_op_fn *fn, char *targetname);
|
||||
extern int idbm_for_each_node(int *found, void *data,
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_ipc.h 2011-01-31 02:35:13.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h 2011-01-31 02:35:29.000000000 -0600
|
||||
@@ -131,4 +131,6 @@ struct iscsi_ipc {
|
||||
int (*recv_pdu_end) (struct iscsi_conn *conn);
|
||||
};
|
||||
|
||||
+struct iscsi_ipc *ipc;
|
||||
+
|
||||
#endif /* ISCSI_IPC_H */
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 02:35:13.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 02:57:55.000000000 -0600
|
||||
@@ -31,7 +31,7 @@ endif
|
||||
OPTFLAGS ?= -O2 -g
|
||||
WARNFLAGS ?= -Wall -Wstrict-prototypes
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../include -I. -I../utils/open-isns \
|
||||
- -D$(OSNAME) $(IPC_CFLAGS)
|
||||
+ -D$(OSNAME) $(IPC_CFLAGS) -DISNS_ENABLE
|
||||
PROGRAMS = iscsid iscsiadm iscsistart
|
||||
|
||||
# libc compat files
|
||||
|
19
iscsi-initiator-utils-brcm-man.patch
Normal file
19
iscsi-initiator-utils-brcm-man.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/docs/brcm_iscsiuio.8 2011-01-31 19:38:19.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/docs/brcm_iscsiuio.8 2011-01-31 19:38:44.000000000 -0600
|
||||
@@ -67,6 +67,15 @@ into the background.
|
||||
.TP
|
||||
.BI -v
|
||||
This is to print the version.
|
||||
+.PP
|
||||
+.TP
|
||||
+.BI -p <pidfile>
|
||||
+Use pidfile (default /var/run/brcm_iscsiuio.pid )
|
||||
+.PP
|
||||
+.TP
|
||||
+.BI -h
|
||||
+Display this help and exit.
|
||||
+
|
||||
|
||||
.\"
|
||||
.\" AUTHOR part
|
39
iscsi-initiator-utils-disable-dsa-code.patch
Normal file
39
iscsi-initiator-utils-disable-dsa-code.patch
Normal file
@ -0,0 +1,39 @@
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/Makefile 2011-01-31 21:01:06.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile 2011-01-31 21:01:22.000000000 -0600
|
||||
@@ -27,7 +27,7 @@ IFACEFILES = etc/iface.example
|
||||
all: user kernel
|
||||
|
||||
user: ;
|
||||
- cd utils/open-isns; ./configure; $(MAKE)
|
||||
+ cd utils/open-isns; ./configure --with-security=no; $(MAKE)
|
||||
$(MAKE) -C utils/sysdeps
|
||||
$(MAKE) -C utils/fwparam_ibft
|
||||
$(MAKE) -C usr
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 21:01:06.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 21:01:22.000000000 -0600
|
||||
@@ -54,10 +54,10 @@ all: $(PROGRAMS)
|
||||
|
||||
iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
|
||||
iscsid.o session_mgmt.o discoveryd.o
|
||||
- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
|
||||
+ $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
|
||||
|
||||
iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
|
||||
- $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns -lcrypto
|
||||
+ $(CC) $(CFLAGS) $^ -o $@ -L../utils/open-isns -lisns
|
||||
|
||||
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
|
||||
iscsistart.o statics.o
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/Makefile.in
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/utils/open-isns/Makefile.in 2011-01-31 21:01:05.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/utils/open-isns/Makefile.in 2011-01-31 21:01:22.000000000 -0600
|
||||
@@ -32,7 +32,6 @@ LIBOBJS = server.o \
|
||||
security.o \
|
||||
authblock.o \
|
||||
policy.o \
|
||||
- pki.o \
|
||||
register.o \
|
||||
query.o \
|
||||
getnext.o \
|
@ -1,9 +1,9 @@
|
||||
diff -aup open-iscsi-2.0-872-rc1-bnx2i/usr/Makefile open-iscsi-2.0-872-rc1-bnx2i.work/usr/Makefile
|
||||
--- open-iscsi-2.0-872-rc1-bnx2i/usr/Makefile 2010-06-18 18:04:51.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/Makefile 2010-06-18 18:13:33.000000000 -0500
|
||||
@@ -60,7 +60,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 06:23:53.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 06:23:14.000000000 -0600
|
||||
@@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_
|
||||
|
||||
iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
|
||||
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
|
||||
iscsistart.o statics.o
|
||||
- $(CC) $(CFLAGS) -static $^ -o $@
|
||||
+ $(CC) $(CFLAGS) $^ -o $@
|
||||
|
@ -1,6 +1,6 @@
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/README 2010-08-18 03:14:34.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2010-08-18 03:26:36.000000000 -0500
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/README 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2011-01-31 06:36:18.000000000 -0600
|
||||
@@ -403,8 +403,9 @@ this the following is not needed for sof
|
||||
Warning!!!!!!
|
||||
This feature is experimental. The interface may change. When reporting
|
||||
@ -47,9 +47,9 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work
|
||||
|
||||
# iscsiadm -m iface
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2010-08-18 03:14:34.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2010-08-18 03:55:19.000000000 -0500
|
||||
@@ -850,11 +850,11 @@ session_conn_reopen(iscsi_conn_t *conn,
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2011-01-31 06:23:53.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2011-01-31 06:36:18.000000000 -0600
|
||||
@@ -670,11 +670,11 @@ session_conn_reopen(iscsi_conn_t *conn,
|
||||
|
||||
static int iscsi_retry_initial_login(struct iscsi_conn *conn)
|
||||
{
|
||||
@ -63,7 +63,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
|
||||
|
||||
memset(&now, 0, sizeof(now));
|
||||
memset(&timeout, 0, sizeof(timeout));
|
||||
@@ -864,7 +864,7 @@ static int iscsi_retry_initial_login(str
|
||||
@@ -684,7 +684,7 @@ static int iscsi_retry_initial_login(str
|
||||
if (gettimeofday(&now, NULL)) {
|
||||
log_error("Could not get time of day. Dropping down to "
|
||||
"max retry check.\n");
|
||||
@ -72,7 +72,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
|
||||
}
|
||||
timeradd(&conn->initial_connect_time, &timeout, &fail_time);
|
||||
|
||||
@@ -873,9 +873,13 @@ static int iscsi_retry_initial_login(str
|
||||
@@ -693,9 +693,13 @@ static int iscsi_retry_initial_login(str
|
||||
* then it is time to give up
|
||||
*/
|
||||
if (timercmp(&now, &fail_time, >)) {
|
||||
@ -90,8 +90,8 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-b
|
||||
}
|
||||
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c 2010-08-18 03:14:34.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c 2010-08-18 03:14:58.000000000 -0500
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c 2011-01-31 06:36:18.000000000 -0600
|
||||
@@ -259,3 +259,16 @@ int iscsi_match_session(void *data, stru
|
||||
info->persistent_address,
|
||||
info->persistent_port, &info->iface);
|
||||
@ -110,8 +110,8 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-
|
||||
+ "after changing the sysctl settings).");
|
||||
+}
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h 2010-08-18 03:14:34.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h 2010-08-18 03:14:58.000000000 -0500
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h 2011-01-31 06:36:18.000000000 -0600
|
||||
@@ -21,4 +21,6 @@ extern int __iscsi_match_session(struct
|
||||
extern char *strstrip(char *s);
|
||||
extern char *cfg_get_string_param(char *pathname, const char *key);
|
||||
@ -120,18 +120,18 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-
|
||||
+
|
||||
#endif
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c 2010-08-18 03:14:34.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c 2010-08-18 03:14:58.000000000 -0500
|
||||
@@ -41,6 +41,13 @@ static void log_login_msg(struct node_re
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c 2011-01-31 06:36:18.000000000 -0600
|
||||
@@ -42,6 +42,13 @@ static void log_login_msg(struct node_re
|
||||
rec->name, rec->conn[0].address,
|
||||
rec->conn[0].port);
|
||||
iscsid_handle_error(rc);
|
||||
iscsi_err_print_msg(rc);
|
||||
+
|
||||
+ /*
|
||||
+ * If using iface binding with tcp then warn about
|
||||
+ * change in kernel behavior.
|
||||
+ */
|
||||
+ if (rc == MGMT_IPC_ERR_TRANS_TIMEOUT)
|
||||
+ if (rc == ISCSI_ERR_TRANS_TIMEOUT)
|
||||
+ iscsi_warn_on_iface_cfg(rec);
|
||||
} else
|
||||
log_info("Login to [iface: %s, target: %s, portal: "
|
||||
|
@ -1,29 +1,16 @@
|
||||
From cac36706909b91ba3254cd8083291bf6746e831b Mon Sep 17 00:00:00 2001
|
||||
From: Ales Kozumplik <akozumpl@redhat.com>
|
||||
Date: Fri, 26 Nov 2010 17:27:42 +0100
|
||||
Subject: [PATCH] Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
|
||||
|
||||
This effectively makes OFFLOAD_BOOT_SUPPORTED always enabled.
|
||||
---
|
||||
usr/iscsi_net_util.c | 2 --
|
||||
1 files changed, 0 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/usr/iscsi_net_util.c b/usr/iscsi_net_util.c
|
||||
index cbe6f56..992d930 100644
|
||||
--- a/usr/iscsi_net_util.c
|
||||
+++ b/usr/iscsi_net_util.c
|
||||
@@ -39,11 +39,9 @@ struct iscsi_net_driver {
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c 2011-01-31 19:24:50.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_net_util.c 2011-01-31 19:26:28.000000000 -0600
|
||||
@@ -39,12 +39,10 @@ struct iscsi_net_driver {
|
||||
};
|
||||
|
||||
static struct iscsi_net_driver net_drivers[] = {
|
||||
-#ifdef OFFLOAD_BOOT_SUPPORTED
|
||||
{"cxgb3", "cxgb3i" },
|
||||
{"cxgb4", "cxgb4i" },
|
||||
{"bnx2", "bnx2i" },
|
||||
{"bnx2x", "bnx2i"},
|
||||
-#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
--
|
||||
1.7.3.2
|
||||
|
||||
|
142752
iscsi-initiator-utils-sync-brcm-0.6.2.13.patch
Normal file
142752
iscsi-initiator-utils-sync-brcm-0.6.2.13.patch
Normal file
File diff suppressed because it is too large
Load Diff
8961
iscsi-initiator-utils-sync-iscsi.patch
Normal file
8961
iscsi-initiator-utils-sync-iscsi.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,29 +1,15 @@
|
||||
From c64e0e5f77b12a81615aa96305a0c3e5730481df Mon Sep 17 00:00:00 2001
|
||||
From: Ales Kozumplik <akozumpl@redhat.com>
|
||||
Date: Thu, 25 Nov 2010 14:00:31 +0100
|
||||
Subject: [PATCH] brcm uio: handle the different iface_rec structures in iscsid and brcm.
|
||||
|
||||
Related: rhbz#442980
|
||||
---
|
||||
brcm_iscsi_uio/include/config.h | 3 ++-
|
||||
brcm_iscsi_uio/include/iscsi_net_util.h | 14 ++++++++++++++
|
||||
brcm_iscsi_uio/src/unix/iscsid_ipc.c | 2 +-
|
||||
3 files changed, 17 insertions(+), 2 deletions(-)
|
||||
create mode 100644 brcm_iscsi_uio/include/iscsi_net_util.h
|
||||
|
||||
diff --git a/brcm_iscsi_uio/include/config.h b/brcm_iscsi_uio/include/config.h
|
||||
index cf6d88b..dfe4355 100644
|
||||
--- a/brcm_iscsi_uio/include/config.h
|
||||
+++ b/brcm_iscsi_uio/include/config.h
|
||||
@@ -25,6 +25,7 @@
|
||||
//#include "types.h"
|
||||
//#include "auth.h" /* for the username and password sizes */
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/config.h open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/config.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/config.h 2011-01-31 19:30:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/config.h 2011-01-31 19:30:05.000000000 -0600
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <netdb.h>
|
||||
#include "list.h"
|
||||
+#include "iscsi_net_util.h"
|
||||
|
||||
/* ISIDs now have a typed naming authority in them. We use an OUI */
|
||||
#define DRIVER_ISID_0 0x00
|
||||
@@ -199,7 +200,7 @@ typedef struct iface_rec {
|
||||
@@ -77,7 +78,7 @@ typedef struct iface_rec {
|
||||
* TODO: we may have to make this bigger and interconnect
|
||||
* specific for infinniband
|
||||
*/
|
||||
@ -32,11 +18,9 @@ index cf6d88b..dfe4355 100644
|
||||
char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
|
||||
/*
|
||||
* This is only used for boot now, but the iser guys
|
||||
diff --git a/brcm_iscsi_uio/include/iscsi_net_util.h b/brcm_iscsi_uio/include/iscsi_net_util.h
|
||||
new file mode 100644
|
||||
index 0000000..2c45fe5
|
||||
--- /dev/null
|
||||
+++ b/brcm_iscsi_uio/include/iscsi_net_util.h
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/iscsi_net_util.h open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/iscsi_net_util.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/include/iscsi_net_util.h 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/include/iscsi_net_util.h 2011-01-31 19:30:05.000000000 -0600
|
||||
@@ -0,0 +1,14 @@
|
||||
+#ifndef __ISCSI_NET_UTIL_h__
|
||||
+#define __ISCSI_NET_UTIL_h__
|
||||
@ -52,11 +36,10 @@ index 0000000..2c45fe5
|
||||
+
|
||||
+#endif
|
||||
+#endif
|
||||
diff --git a/brcm_iscsi_uio/src/unix/iscsid_ipc.c b/brcm_iscsi_uio/src/unix/iscsid_ipc.c
|
||||
index 4c00ef2..67b002a 100644
|
||||
--- a/brcm_iscsi_uio/src/unix/iscsid_ipc.c
|
||||
+++ b/brcm_iscsi_uio/src/unix/iscsid_ipc.c
|
||||
@@ -349,7 +349,7 @@ int process_iscsid_broadcast(int s2)
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/src/unix/iscsid_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/src/unix/iscsid_ipc.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/brcm_iscsi_uio/src/unix/iscsid_ipc.c 2011-01-31 19:30:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/brcm_iscsi_uio/src/unix/iscsid_ipc.c 2011-01-31 19:30:05.000000000 -0600
|
||||
@@ -508,7 +508,7 @@ int process_iscsid_broadcast(int s2)
|
||||
}
|
||||
|
||||
/* This will be freed by parse_iface_thread() */
|
||||
@ -65,6 +48,3 @@ index 4c00ef2..67b002a 100644
|
||||
if(data == NULL) {
|
||||
LOG_ERR(PFX "Couldn't allocate memory for iface data");
|
||||
return -ENOMEM;
|
||||
--
|
||||
1.7.3.2
|
||||
|
||||
|
@ -1,35 +1,201 @@
|
||||
diff --git a/usr/Makefile b/usr/Makefile
|
||||
index e9d6bd1..8e505bf 100644
|
||||
--- a/usr/Makefile
|
||||
+++ b/usr/Makefile
|
||||
@@ -42,7 +42,7 @@ ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o login.o log.o md5.o sha1.o iface.o \
|
||||
iscsid_req.o $(SYSDEPS_SRCS)
|
||||
# core initiator files
|
||||
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o \
|
||||
- transport.o cxgb3i.o be2iscsi.o
|
||||
+ transport.o cxgb3i.o be2iscsi.o uip_mgmt_ipc.o
|
||||
# fw boot files
|
||||
FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h 2011-01-31 03:43:51.000000000 -0600
|
||||
@@ -58,6 +58,8 @@ enum {
|
||||
ISCSI_ERR_ISNS_QUERY = 25,
|
||||
/* iSNS registration/deregistration failed */
|
||||
ISCSI_ERR_ISNS_REG_FAILED = 26,
|
||||
+ /* Operation failed, but retrying layer may succeed */
|
||||
+ ISCSI_ERR_AGAIN = 27,
|
||||
|
||||
diff --git a/usr/initiator.c b/usr/initiator.c
|
||||
index 1c9d8b6..8f7a383 100644
|
||||
--- a/usr/initiator.c
|
||||
+++ b/usr/initiator.c
|
||||
/* Always last. Indicates end of error code space */
|
||||
ISCSI_MAX_ERR_VAL,
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2011-01-31 03:45:36.000000000 -0600
|
||||
@@ -13,7 +13,7 @@ TESTS += tests/test_set_auth tests/test_
|
||||
|
||||
COMMON_SRCS = sysdeps.o
|
||||
# sources shared between iscsid, iscsiadm and iscsistart
|
||||
-ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
|
||||
+ISCSI_LIB_SRCS = netlink.o uip_mgmt_ipc.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
|
||||
FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
|
||||
|
||||
# sources shared with the userspace utils, note we build these separately
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2011-01-31 06:18:58.000000000 -0600
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "iscsi_sysfs.h"
|
||||
#include "iscsi_settings.h"
|
||||
#include "iface.h"
|
||||
+#include "host.h"
|
||||
#include "sysdeps.h"
|
||||
#include "iscsi_err.h"
|
||||
|
||||
#define ISCSI_CONN_ERR_REOPEN_DELAY 3
|
||||
@@ -743,6 +744,38 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
|
||||
@@ -554,6 +555,48 @@ static int iscsi_conn_connect(struct isc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int __set_net_config(struct iscsi_transport *t,
|
||||
+ iscsi_session_t *session,
|
||||
+ struct iface_rec *iface)
|
||||
+static void iscsi_uio_poll_login_timedout(void *data)
|
||||
+{
|
||||
+ struct queue_task *qtask = data;
|
||||
+ struct iscsi_conn *conn = qtask->conn;
|
||||
+ iscsi_session_t *session = conn->session;
|
||||
+
|
||||
+ log_debug(3, "timeout waiting for UIO ...\n");
|
||||
+ mgmt_ipc_write_rsp(qtask, ISCSI_ERR_TRANS_TIMEOUT);
|
||||
+ conn_delete_timers(conn);
|
||||
+ __session_destroy(session);
|
||||
+}
|
||||
+
|
||||
+static int iscsi_sched_uio_poll(queue_task_t *qtask)
|
||||
+{
|
||||
+ struct iscsi_conn *conn = qtask->conn;
|
||||
+ struct iscsi_session *session = conn->session;
|
||||
+ struct iscsi_transport *t = session->t;
|
||||
+ struct iscsi_ev_context *ev_context;
|
||||
+
|
||||
+ if (!t->template->set_net_config)
|
||||
+ return 0;
|
||||
+
|
||||
+ ev_context = iscsi_ev_context_get(conn, 0);
|
||||
+ if (!ev_context) {
|
||||
+ /* while reopening the recv pool should be full */
|
||||
+ log_error("BUG: __session_conn_reopen could "
|
||||
+ "not get conn context for recv.");
|
||||
+ return ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ ev_context->data = qtask;
|
||||
+ conn->state = STATE_XPT_WAIT;
|
||||
+
|
||||
+ iscsi_sched_ev_context(ev_context, conn, 0, EV_UIO_POLL);
|
||||
+
|
||||
+ log_debug(3, "Setting login UIO poll timer %p timeout %d",
|
||||
+ &conn->login_timer, conn->login_timeout);
|
||||
+ actor_timer(&conn->login_timer, conn->login_timeout * 1000,
|
||||
+ iscsi_uio_poll_login_timedout, qtask);
|
||||
+ return EAGAIN;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
||||
int redirected)
|
||||
@@ -595,6 +638,11 @@ __session_conn_reopen(iscsi_conn_t *conn
|
||||
if (!redirected)
|
||||
session->reopen_cnt++;
|
||||
|
||||
+ /* uIP will needs to be re-triggered on the connection re-open */
|
||||
+ if (iscsi_set_net_config(conn->session->t, conn->session,
|
||||
+ &conn->session->nrec.iface) != 0)
|
||||
+ goto queue_reopen;
|
||||
+
|
||||
if (iscsi_conn_connect(conn, qtask)) {
|
||||
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
|
||||
goto queue_reopen;
|
||||
@@ -1550,6 +1598,53 @@ cleanup:
|
||||
session_conn_shutdown(conn, qtask, err);
|
||||
}
|
||||
|
||||
+static void session_conn_uio_poll(void *data)
|
||||
+{
|
||||
+ struct iscsi_ev_context *ev_context = data;
|
||||
+ iscsi_conn_t *conn = ev_context->conn;
|
||||
+ struct iscsi_session *session = conn->session;
|
||||
+ queue_task_t *qtask = ev_context->data;
|
||||
+ int rc;
|
||||
+
|
||||
+ log_debug(4, "retrying uio poll");
|
||||
+ rc = iscsi_set_net_config(session->t, session,
|
||||
+ &conn->session->nrec.iface);
|
||||
+ if (rc != 0) {
|
||||
+ if (rc == ISCSI_ERR_AGAIN) {
|
||||
+ ev_context->data = qtask;
|
||||
+ iscsi_sched_ev_context(ev_context, conn, 2,
|
||||
+ EV_UIO_POLL);
|
||||
+ return;
|
||||
+ } else {
|
||||
+ log_error("session_conn_uio_poll() "
|
||||
+ "connection failure [0x%x]", rc);
|
||||
+ actor_delete(&conn->login_timer);
|
||||
+ iscsi_login_eh(conn, qtask, ISCSI_ERR_INTERNAL);
|
||||
+ iscsi_ev_context_put(ev_context);
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ iscsi_ev_context_put(ev_context);
|
||||
+ actor_delete(&conn->login_timer);
|
||||
+ log_debug(4, "UIO ready trying connect");
|
||||
+
|
||||
+ /* uIP is ready try to connect */
|
||||
+ if (gettimeofday(&conn->initial_connect_time, NULL))
|
||||
+ log_error("Could not get initial connect time. If "
|
||||
+ "login errors iscsid may give up the initial "
|
||||
+ "login early. You should manually login.");
|
||||
+
|
||||
+ conn->state = STATE_XPT_WAIT;
|
||||
+ if (iscsi_conn_connect(conn, qtask)) {
|
||||
+ int delay = ISCSI_CONN_ERR_REOPEN_DELAY;
|
||||
+
|
||||
+ log_debug(4, "Waiting %u seconds before trying to reconnect.\n",
|
||||
+ delay);
|
||||
+ queue_delayed_reopen(qtask, delay);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
|
||||
struct iscsi_conn *conn, unsigned long tmo,
|
||||
int event)
|
||||
@@ -1586,6 +1681,11 @@ static int iscsi_sched_ev_context(struct
|
||||
ev_context);
|
||||
actor_schedule(&ev_context->actor);
|
||||
break;
|
||||
+ case EV_UIO_POLL:
|
||||
+ actor_new(&ev_context->actor, session_conn_uio_poll,
|
||||
+ ev_context);
|
||||
+ actor_schedule(&ev_context->actor);
|
||||
+ break;
|
||||
case EV_CONN_LOGOUT_TIMER:
|
||||
actor_timer(&ev_context->actor, tmo * 1000,
|
||||
iscsi_logout_timedout, ev_context);
|
||||
@@ -1714,7 +1814,17 @@ session_login_task(node_rec_t *rec, queu
|
||||
conn = &session->conn[0];
|
||||
qtask->conn = conn;
|
||||
|
||||
- if (iscsi_host_set_net_params(&rec->iface, session)) {
|
||||
+ rc = iscsi_host_set_net_params(&rec->iface, session);
|
||||
+ if (rc == ISCSI_ERR_AGAIN) {
|
||||
+ iscsi_sched_uio_poll(qtask);
|
||||
+ /*
|
||||
+ * Cannot block iscsid, so caller is going to internally
|
||||
+ * retry the operation.
|
||||
+ */
|
||||
+ qtask->rsp.command = MGMT_IPC_SESSION_LOGIN;
|
||||
+ qtask->rsp.err = ISCSI_SUCCESS;
|
||||
+ return ISCSI_SUCCESS;
|
||||
+ } else if (rc) {
|
||||
__session_destroy(session);
|
||||
return ISCSI_ERR_LOGIN;
|
||||
}
|
||||
@@ -1864,6 +1974,7 @@ iscsi_host_send_targets(queue_task_t *qt
|
||||
struct sockaddr_storage *ss)
|
||||
{
|
||||
struct iscsi_transport *t;
|
||||
+ int rc;
|
||||
|
||||
t = iscsi_sysfs_get_transport_by_hba(host_no);
|
||||
if (!t) {
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c 2011-01-31 04:22:50.000000000 -0600
|
||||
@@ -555,6 +555,36 @@ TODO handle this
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int iscsi_set_net_config(struct iscsi_transport *t, iscsi_session_t *session,
|
||||
+ struct iface_rec *iface)
|
||||
+{
|
||||
+ if (t->template->set_net_config) {
|
||||
+ /* uip needs the netdev name */
|
||||
@ -58,37 +224,43 @@ index 1c9d8b6..8f7a383 100644
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static void
|
||||
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
||||
int redirected)
|
||||
@@ -784,6 +817,11 @@ __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
||||
if (!redirected)
|
||||
session->reopen_cnt++;
|
||||
|
||||
+ /* uIP will needs to be re-triggered on the connection re-open */
|
||||
+ if (__set_net_config(conn->session->t, conn->session,
|
||||
+ &conn->session->nrec.iface) != 0)
|
||||
+ goto queue_reopen;
|
||||
+
|
||||
if (iscsi_conn_connect(conn, qtask)) {
|
||||
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
|
||||
goto queue_reopen;
|
||||
@@ -2130,6 +2168,10 @@ static int iface_set_param(struct iscsi_transport *t, struct iface_rec *iface,
|
||||
int iscsi_host_set_net_params(struct iface_rec *iface,
|
||||
struct iscsi_session *session)
|
||||
{
|
||||
@@ -576,6 +606,10 @@ int iscsi_host_set_net_params(struct ifa
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
+ rc = __set_net_config(t, session, iface);
|
||||
+ rc = iscsi_set_net_config(t, session, iface);
|
||||
+ if (rc != 0)
|
||||
+ return rc;
|
||||
+
|
||||
rc = __iscsi_host_set_param(t, session->hostno,
|
||||
ISCSI_HOST_PARAM_IPADDRESS,
|
||||
iface->ipaddress, ISCSI_STRING);
|
||||
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
|
||||
index 5280a0a..6eb8b1d 100644
|
||||
--- a/usr/iscsid_req.c
|
||||
+++ b/usr/iscsid_req.c
|
||||
rc = host_set_param(t, session->hostno,
|
||||
ISCSI_HOST_PARAM_IPADDRESS,
|
||||
iface->ipaddress, ISCSI_STRING);
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h 2011-01-31 03:40:12.000000000 -0600
|
||||
@@ -89,6 +89,7 @@ typedef enum iscsi_event_e {
|
||||
EV_CONN_ERROR,
|
||||
EV_CONN_LOGOUT_TIMER,
|
||||
EV_CONN_STOP,
|
||||
+ EV_UIO_POLL,
|
||||
} iscsi_event_e;
|
||||
|
||||
struct queue_task;
|
||||
@@ -356,5 +357,8 @@ extern void iscsi_copy_operational_param
|
||||
extern int iscsi_setup_authentication(struct iscsi_session *session,
|
||||
struct iscsi_auth_config *auth_cfg);
|
||||
extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
|
||||
+extern int iscsi_set_net_config(struct iscsi_transport *t,
|
||||
+ iscsi_session_t *session,
|
||||
+ struct iface_rec *iface);
|
||||
|
||||
#endif /* INITIATOR_H */
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c 2011-01-31 03:45:09.000000000 -0600
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -97,25 +269,24 @@ index 5280a0a..6eb8b1d 100644
|
||||
#include <sys/un.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
@@ -31,6 +32,7 @@
|
||||
#include "mgmt_ipc.h"
|
||||
@@ -32,6 +33,7 @@
|
||||
#include "iscsi_util.h"
|
||||
#include "config.h"
|
||||
#include "iscsi_err.h"
|
||||
+#include "uip_mgmt_ipc.h"
|
||||
|
||||
static void iscsid_startup(void)
|
||||
{
|
||||
@@ -51,7 +53,8 @@ static void iscsid_startup(void)
|
||||
@@ -52,7 +54,7 @@ static void iscsid_startup(void)
|
||||
|
||||
#define MAXSLEEP 128
|
||||
|
||||
-static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
|
||||
+static mgmt_ipc_err_e ipc_connect(int *fd, char *unix_sock_name,
|
||||
+ int start_iscsid)
|
||||
-static int iscsid_connect(int *fd, int start_iscsid)
|
||||
+static int ipc_connect(int *fd, char *unix_sock_name, int start_iscsid)
|
||||
{
|
||||
int nsec;
|
||||
struct sockaddr_un addr;
|
||||
@@ -64,8 +67,8 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
|
||||
@@ -65,8 +67,8 @@ static int iscsid_connect(int *fd, int s
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.sun_family = AF_LOCAL;
|
||||
@ -126,23 +297,24 @@ index 5280a0a..6eb8b1d 100644
|
||||
/*
|
||||
* Trying to connect with exponential backoff
|
||||
*/
|
||||
@@ -93,6 +96,11 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
|
||||
return MGMT_IPC_ERR_ISCSID_NOTCONN;
|
||||
@@ -94,6 +96,11 @@ static int iscsid_connect(int *fd, int s
|
||||
return ISCSI_ERR_ISCSID_NOTCONN;
|
||||
}
|
||||
|
||||
+static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
|
||||
+static int iscsid_connect(int *fd, int start_iscsid)
|
||||
+{
|
||||
+ return ipc_connect(fd, ISCSIADM_NAMESPACE, start_iscsid);
|
||||
+ return ipc_connect(fd, ISCSIADM_NAMESPACE, start_iscsid);
|
||||
+}
|
||||
+
|
||||
mgmt_ipc_err_e iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid)
|
||||
int iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid)
|
||||
{
|
||||
int err;
|
||||
@@ -190,6 +198,72 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
|
||||
@@ -190,3 +197,81 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
|
||||
return err;
|
||||
return iscsid_req_wait(cmd, fd);
|
||||
}
|
||||
|
||||
+static mgmt_ipc_err_e uip_connect(int *fd)
|
||||
+
|
||||
+static int uip_connect(int *fd)
|
||||
+{
|
||||
+ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0);
|
||||
+}
|
||||
@ -161,25 +333,29 @@ index 5280a0a..6eb8b1d 100644
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ log_debug(3, "connected to uIP daemon");
|
||||
+
|
||||
+ /* Send the data to uIP */
|
||||
+ if ((err = write(fd, buf, buf_len)) != buf_len) {
|
||||
+ log_error("got write error (%d/%d), daemon died?",
|
||||
+ err, errno);
|
||||
+ err, errno);
|
||||
+ close(fd);
|
||||
+ return -EIO;
|
||||
+ return ISCSI_ERR_ISCSID_COMM_ERR;
|
||||
+ }
|
||||
+
|
||||
+ log_debug(3, "send iface config to uIP daemon");
|
||||
+
|
||||
+ /* Set the socket to a non-blocking read, this way if there are
|
||||
+ * problems waiting for uIP, iscsid can bailout early */
|
||||
+ flags = fcntl(fd, F_GETFL, 0);
|
||||
+ if (flags == -1)
|
||||
+ flags = 0;
|
||||
+ flags = 0;
|
||||
+ err = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
|
||||
+ if(err != 0) {
|
||||
+ log_error("could not set uip broadcast to non-blocking: %d",
|
||||
+ errno);
|
||||
+ close(fd);
|
||||
+ return -EIO;
|
||||
+ return ISCSI_ERR;
|
||||
+ }
|
||||
+
|
||||
+#define MAX_UIP_BROADCAST_READ_TRIES 3
|
||||
@ -187,8 +363,10 @@ index 5280a0a..6eb8b1d 100644
|
||||
+ /* Wait for the response */
|
||||
+ err = read(fd, &rsp, sizeof(rsp));
|
||||
+ if (err == sizeof(rsp)) {
|
||||
+ log_debug(3, "Broadcasted to uIP with length: %ld\n",
|
||||
+ buf_len);
|
||||
+ log_debug(3, "Broadcasted to uIP with length: %ld "
|
||||
+ "cmd: 0x%x rsp: 0x%x\n", buf_len,
|
||||
+ rsp.command, rsp.err);
|
||||
+ err = 0;
|
||||
+ break;
|
||||
+ } else if((err == -1) && (errno == EAGAIN)) {
|
||||
+ usleep(250000);
|
||||
@ -196,45 +374,68 @@ index 5280a0a..6eb8b1d 100644
|
||||
+ } else {
|
||||
+ log_error("Could not read response (%d/%d), daemon died?",
|
||||
+ err, errno);
|
||||
+ err = ISCSI_ERR;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(count == MAX_UIP_BROADCAST_READ_TRIES)
|
||||
+ log_error("Could not broadcast to uIP");
|
||||
+ if (count == MAX_UIP_BROADCAST_READ_TRIES) {
|
||||
+ log_error("Could not broadcast to uIP after %d tries",
|
||||
+ count);
|
||||
+ err = ISCSI_ERR_AGAIN;
|
||||
+ } else if (rsp.err != ISCISD_UIP_MGMT_IPC_DEVICE_UP) {
|
||||
+ log_debug(3, "Device is not ready\n");
|
||||
+ err = ISCSI_ERR_AGAIN;
|
||||
+ }
|
||||
+
|
||||
+ close(fd);
|
||||
+
|
||||
+ return 0;
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
void iscsid_handle_error(mgmt_ipc_err_e err)
|
||||
{
|
||||
static char *err_msgs[] = {
|
||||
diff --git a/usr/iscsid_req.h b/usr/iscsid_req.h
|
||||
index 3bba2f4..e2cf1c3 100644
|
||||
--- a/usr/iscsid_req.h
|
||||
+++ b/usr/iscsid_req.h
|
||||
@@ -34,4 +34,6 @@ extern int iscsid_req_by_rec(int cmd, struct node_rec *rec);
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h 2011-01-31 03:11:02.000000000 -0600
|
||||
@@ -33,4 +33,6 @@ extern int iscsid_req_by_rec(int cmd, st
|
||||
extern int iscsid_req_by_sid_async(int cmd, int sid, int *fd);
|
||||
extern int iscsid_req_by_sid(int cmd, int sid);
|
||||
|
||||
+extern int uip_broadcast(void *buf, size_t buf_len);
|
||||
+
|
||||
#endif
|
||||
diff --git a/usr/transport.c b/usr/transport.c
|
||||
index c0789bb..aa0395c 100644
|
||||
--- a/usr/transport.c
|
||||
+++ b/usr/transport.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c 2011-01-31 03:44:25.000000000 -0600
|
||||
@@ -49,6 +49,7 @@ static char *iscsi_err_msgs[] = {
|
||||
/* 24 */ "iSCSI login failed due to authorization failure",
|
||||
/* 25 */ "iSNS query failed",
|
||||
/* 26 */ "iSNS registration failed",
|
||||
+ /* 27 */ "Retryable failure",
|
||||
};
|
||||
|
||||
char *iscsi_err_to_str(int err)
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 03:23:30.000000000 -0600
|
||||
@@ -40,7 +40,7 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysde
|
||||
ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
|
||||
sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
|
||||
iscsi_net_util.o iscsid_req.o transport.o cxgbi.o be2iscsi.o \
|
||||
- initiator_common.o iscsi_err.o $(IPC_OBJ) $(SYSDEPS_SRCS)
|
||||
+ initiator_common.o iscsi_err.o uip_mgmt_ipc.o $(IPC_OBJ) $(SYSDEPS_SRCS)
|
||||
# core initiator files
|
||||
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o
|
||||
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c 2011-01-31 03:37:05.000000000 -0600
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "log.h"
|
||||
#include "iscsi_util.h"
|
||||
#include "iscsi_sysfs.h"
|
||||
+#include "uip_mgmt_ipc.h"
|
||||
#include "cxgb3i.h"
|
||||
#include "cxgbi.h"
|
||||
#include "be2iscsi.h"
|
||||
|
||||
@@ -58,6 +59,7 @@ struct iscsi_transport_template bnx2i = {
|
||||
@@ -67,6 +68,7 @@ struct iscsi_transport_template bnx2i =
|
||||
.ep_connect = ktransport_ep_connect,
|
||||
.ep_poll = ktransport_ep_poll,
|
||||
.ep_disconnect = ktransport_ep_disconnect,
|
||||
@ -242,10 +443,9 @@ index c0789bb..aa0395c 100644
|
||||
};
|
||||
|
||||
struct iscsi_transport_template be2iscsi = {
|
||||
diff --git a/usr/transport.h b/usr/transport.h
|
||||
index 5ceedb3..2ec903c 100644
|
||||
--- a/usr/transport.h
|
||||
+++ b/usr/transport.h
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h 2011-01-31 03:10:47.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h 2011-01-31 03:11:02.000000000 -0600
|
||||
@@ -35,6 +35,9 @@ struct iscsi_transport_template {
|
||||
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
|
||||
void (*ep_disconnect) (struct iscsi_conn *conn);
|
||||
@ -256,11 +456,9 @@ index 5ceedb3..2ec903c 100644
|
||||
};
|
||||
|
||||
/* represents data path provider */
|
||||
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
|
||||
new file mode 100644
|
||||
index 0000000..73b1632
|
||||
--- /dev/null
|
||||
+++ b/usr/uip_mgmt_ipc.c
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c 2011-01-31 03:11:02.000000000 -0600
|
||||
@@ -0,0 +1,41 @@
|
||||
+/*
|
||||
+ * uIP iSCSI Daemon/Admin Management IPC
|
||||
@ -303,12 +501,10 @@ index 0000000..73b1632
|
||||
+ sizeof(iscsid_uip_broadcast_header_t) +
|
||||
+ sizeof(*iface));
|
||||
+}
|
||||
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
|
||||
new file mode 100644
|
||||
index 0000000..dd49c0b
|
||||
--- /dev/null
|
||||
+++ b/usr/uip_mgmt_ipc.h
|
||||
@@ -0,0 +1,71 @@
|
||||
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h 1969-12-31 18:00:00.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h 2011-01-31 03:40:12.000000000 -0600
|
||||
@@ -0,0 +1,73 @@
|
||||
+/*
|
||||
+ * uIP iSCSI Daemon/Admin Management IPC
|
||||
+ *
|
||||
@ -366,6 +562,8 @@ index 0000000..dd49c0b
|
||||
+ ISCISD_UIP_MGMT_IPC_ERR = 1,
|
||||
+ ISCISD_UIP_MGMT_IPC_ERR_NOT_FOUND = 2,
|
||||
+ ISCISD_UIP_MGMT_IPC_ERR_NOMEM = 3,
|
||||
+ ISCISD_UIP_MGMT_IPC_DEVICE_UP = 4,
|
||||
+ ISCISD_UIP_MGMT_IPC_DEVICE_INITIALIZING = 5,
|
||||
+} iscsid_uip_mgmt_ipc_err_e;
|
||||
+
|
||||
+/* IPC Response */
|
||||
@ -380,6 +578,3 @@ index 0000000..dd49c0b
|
||||
+
|
||||
+
|
||||
+#endif /* UIP_MGMT_IPC_H */
|
||||
--
|
||||
1.6.6.1
|
||||
|
||||
|
@ -1,16 +1,16 @@
|
||||
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bnx2i.diff/doc/iscsiadm.8
|
||||
--- open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 2010-07-11 03:45:50.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/doc/iscsiadm.8 2010-07-11 04:00:35.000000000 -0500
|
||||
@@ -51,7 +51,7 @@ display help text and exit
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/doc/iscsiadm.8 2011-01-31 02:32:51.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/doc/iscsiadm.8 2011-01-31 02:33:29.000000000 -0600
|
||||
@@ -57,7 +57,7 @@ scsi layer.
|
||||
.TP
|
||||
\fB\-I\fR, \fB\-\-interface\fI[iface]\fR
|
||||
\fB\-I\fR, \fB\-\-interface=\fI[iface]\fR
|
||||
The interface argument specifies the iSCSI interface to use for the operation.
|
||||
-iSCSI interfaces (iface) are defined in /etc/iscsi/ifaces. For hardware
|
||||
+iSCSI interfaces (iface) are defined in /var/lib/iscsi/ifaces. For hardware
|
||||
iSCSI (qla4xxx) the iface config must have the hardware address
|
||||
(iface.hwaddress = port's MAC address)
|
||||
and the driver/transport_name (iface.transport_name). The iface's name is
|
||||
@@ -128,7 +128,7 @@ If no other options are specified: for \
|
||||
@@ -134,7 +134,7 @@ If no other options are specified: for \
|
||||
of their respective records are displayed; for \fIsession\fR, all active
|
||||
sessions and connections are displayed; for \fIfw\fR, all boot firmware
|
||||
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
|
||||
@ -19,7 +19,7 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bn
|
||||
|
||||
.TP
|
||||
\fB\-n\fR, \fB\-\-name=\fIname\fR
|
||||
@@ -336,10 +336,10 @@ The configuration file read by \fBiscsid
|
||||
@@ -488,10 +488,10 @@ The configuration file read by \fBiscsid
|
||||
The file containing the iSCSI InitiatorName and InitiatorAlias read by
|
||||
\fBiscsid\fR and \fBiscsiadm\fR on startup.
|
||||
.TP
|
||||
@ -32,10 +32,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-872-rc3-bn
|
||||
This directory contains the portals.
|
||||
|
||||
.SH "SEE ALSO"
|
||||
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/doc: iscsiadm.8.orig
|
||||
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/README open-iscsi-2.0-872-rc3-bnx2i.diff/README
|
||||
--- open-iscsi-2.0-872-rc3-bnx2i/README 2010-07-11 03:58:50.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/README 2010-07-11 03:59:00.000000000 -0500
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/README 2011-01-31 02:32:57.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2011-01-31 02:33:29.000000000 -0600
|
||||
@@ -144,10 +144,10 @@ available on all Linux installations.
|
||||
|
||||
The database contains two tables:
|
||||
@ -175,11 +174,10 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/README open-iscsi-2.0-872-rc3-bnx2i.diff
|
||||
|
||||
Note that for iSNS the poll_interval does not have to be set. If not set,
|
||||
iscsid will only perform rediscovery when it gets a SCN from the server.
|
||||
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/: README.orig
|
||||
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.c
|
||||
--- open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c 2010-07-11 03:58:50.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.c 2010-07-11 03:59:00.000000000 -0500
|
||||
@@ -2235,9 +2235,9 @@ free_info:
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.c 2011-01-31 02:32:57.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c 2011-01-31 02:33:29.000000000 -0600
|
||||
@@ -2285,9 +2285,9 @@ free_info:
|
||||
int idbm_init(idbm_get_config_file_fn *fn)
|
||||
{
|
||||
/* make sure root db dir is there */
|
||||
@ -192,10 +190,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.c open-iscsi-2.0-872-rc3-bnx2i.
|
||||
errno);
|
||||
return errno;
|
||||
}
|
||||
Only in open-iscsi-2.0-872-rc3-bnx2i.diff/usr: idbm.c.orig
|
||||
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.h
|
||||
--- open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h 2010-07-11 03:45:50.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.h 2010-07-11 03:59:00.000000000 -0500
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/idbm.h 2011-01-31 02:32:51.000000000 -0600
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h 2011-01-31 02:33:29.000000000 -0600
|
||||
@@ -27,12 +27,15 @@
|
||||
#include "initiator.h"
|
||||
#include "config.h"
|
||||
@ -218,9 +215,9 @@ diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/idbm.h open-iscsi-2.0-872-rc3-bnx2i.
|
||||
#define ST_CONFIG_NAME "st_config"
|
||||
#define ISNS_CONFIG_NAME "isns_config"
|
||||
|
||||
diff -aurp open-iscsi-2.0-872-rc3-bnx2i/usr/iface.h open-iscsi-2.0-872-rc3-bnx2i.diff/usr/iface.h
|
||||
--- open-iscsi-2.0-872-rc3-bnx2i/usr/iface.h 2010-07-11 03:45:50.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/iface.h 2010-07-11 03:59:00.000000000 -0500
|
||||
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.h
|
||||
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iface.h 2010-07-11 04:05:58.000000000 -0500
|
||||
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iface.h 2011-01-31 02:33:29.000000000 -0600
|
||||
@@ -20,7 +20,9 @@
|
||||
#ifndef ISCSI_IFACE_H
|
||||
#define ISCSI_IFACE_H
|
||||
|
@ -3,54 +3,46 @@
|
||||
Summary: iSCSI daemon and utility programs
|
||||
Name: iscsi-initiator-utils
|
||||
Version: 6.2.0.872
|
||||
Release: 13%{?dist}
|
||||
Release: 14%{?dist}
|
||||
Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc4-bnx2i.tar.gz
|
||||
Source1: iscsid.init
|
||||
Source2: iscsidevs.init
|
||||
Source3: 04-iscsi
|
||||
# Add Red Hat specific info to docs.
|
||||
Patch0: iscsi-initiator-utils-update-initscripts-and-docs.patch
|
||||
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
|
||||
Patch1: iscsi-initiator-utils-use-var-for-config.patch
|
||||
# Add redhat.com string to default initiator name.
|
||||
Patch2: iscsi-initiator-utils-use-red-hat-for-name.patch
|
||||
# Add a lib for use by anaconda.
|
||||
Patch3: iscsi-initiator-utils-add-libiscsi.patch
|
||||
# Add bnx2i support.
|
||||
Patch4: iscsi-initiator-utils-uip-mgmt.patch
|
||||
# disable isns for libiscsi (libiscsi does not support isns)
|
||||
Patch5: iscsi-initiator-utils-disable-isns-for-lib.patch
|
||||
# fix libiscsi get firmware sysfs init
|
||||
Patch6: iscsi-initiator-utils-fix-lib-sysfs-init.patch
|
||||
# fix race between uip and iscsid startup
|
||||
Patch7: iscsi-initiator-utils-fix-uip-init-race.patch
|
||||
# Don't compile iscsistart as static
|
||||
Patch8: iscsi-initiator-utils-dont-use-static.patch
|
||||
# Fix brcm nic state
|
||||
Patch9: iscsi-initiator-utils-fix-brcm-nic-state.patch
|
||||
# Fix iface op return value
|
||||
Patch10: iscsi-initiator-utils-fix-iface-op-ret-val.patch
|
||||
# Fix brcm VLAN
|
||||
Patch11: iscsi-initiator-utils-fix-uip-vlan-support.patch
|
||||
# Fix brcm 10G wrap
|
||||
Patch12: iscsi-initiator-utils-fix-uip-10G-wrap.patch
|
||||
# brcm uIP version Bump
|
||||
Patch13: iscsi-initiator-utils-fix-uip-rhel-version-bump.patch
|
||||
# Log message and hint when login failed and using iface binding.
|
||||
Patch14: iscsi-initiator-utils-log-login-failed.patch
|
||||
# brcm uio: handle the different iface_rec structures in iscsid and brcm.
|
||||
Patch15: iscsi-initiator-utils-uio-handle-different-iface_rec.patch
|
||||
# Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
|
||||
Patch16: iscsi-initiator-utils-remove-the-offload-boot-supported-ifdef.patch
|
||||
# libiscsi: reimplement fw discovery so partial devices are used properly.
|
||||
Patch17: iscsi-initiator-utils-libiscsi-partial-offload-discovery.patch
|
||||
|
||||
# sync brcm to 0.6.2.13
|
||||
Patch0: iscsi-initiator-utils-sync-brcm-0.6.2.13.patch
|
||||
# sync iscsi tools to upstream commit cc425fd44b24d9fda74395951570460fc919d076
|
||||
Patch1: iscsi-initiator-utils-sync-iscsi.patch
|
||||
# Add Red Hat specific info to docs.
|
||||
Patch2: iscsi-initiator-utils-update-initscripts-and-docs.patch
|
||||
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
|
||||
Patch3: iscsi-initiator-utils-use-var-for-config.patch
|
||||
# Add redhat.com string to default initiator name.
|
||||
Patch4: iscsi-initiator-utils-use-red-hat-for-name.patch
|
||||
# Add a lib for use by anaconda.
|
||||
Patch5: iscsi-initiator-utils-add-libiscsi.patch
|
||||
# Add bnx2i support.
|
||||
Patch6: iscsi-initiator-utils-uip-mgmt.patch
|
||||
# Don't compile iscsistart as static
|
||||
Patch7: iscsi-initiator-utils-dont-use-static.patch
|
||||
# Log message and hint when login failed and using iface binding.
|
||||
Patch8: iscsi-initiator-utils-log-login-failed.patch
|
||||
# Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
|
||||
Patch9: iscsi-initiator-utils-remove-the-offload-boot-supported-ifdef.patch
|
||||
# libiscsi: reimplement fw discovery so partial devices are used properly.
|
||||
Patch10: iscsi-initiator-utils-libiscsi-partial-offload-discovery.patch
|
||||
# brcm uio: handle the different iface_rec structures in iscsid and brcm.
|
||||
Patch11: iscsi-initiator-utils-uio-handle-different-iface_rec.patch
|
||||
# Document missing brcm arguments
|
||||
Patch12: iscsi-initiator-utils-brcm-man.patch
|
||||
# Don't build unused isns dsa code.
|
||||
Patch13: iscsi-initiator-utils-disable-dsa-code.patch
|
||||
|
||||
Group: System Environment/Daemons
|
||||
License: GPLv2+
|
||||
URL: http://www.open-iscsi.org
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: openssl-devel flex bison python-devel doxygen
|
||||
BuildRequires: flex bison python-devel doxygen
|
||||
|
||||
Requires(post): chkconfig
|
||||
Requires(preun): chkconfig /sbin/service
|
||||
@ -72,28 +64,24 @@ developing applications that use %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -n open-iscsi-2.0-872-rc4-bnx2i
|
||||
%patch0 -p1 -b .update-initscripts-and-docs
|
||||
%patch1 -p1 -b .use-var-for-config
|
||||
%patch2 -p1 -b .use-red-hat-for-name
|
||||
%patch3 -p1 -b .add-libiscsi
|
||||
%patch4 -p1 -b .uip-mgmt
|
||||
%patch5 -p1 -b .disable-isns-for-lib
|
||||
%patch6 -p1 -b .fix-lib-sysfs-init
|
||||
%patch7 -p1 -b .fix-uip-init-race
|
||||
%patch8 -p1 -b .dont-use-static
|
||||
%patch9 -p1 -b .fix-brcm-nic-state
|
||||
%patch10 -p1 -b .fix-iface-op-ret-val
|
||||
%patch11 -p1 -b .fix-brcm-vlan
|
||||
%patch12 -p1 -b .fix-brcm-10G-wrap
|
||||
%patch13 -p1 -b .fix-brcm-version-bump
|
||||
%patch14 -p1 -b .log-login-failed
|
||||
%patch15 -p1 -b .uio-different-iface
|
||||
%patch16 -p1 -b .offload-boot-supported
|
||||
%patch17 -p1 -b .libiscsi-partial-offload
|
||||
%patch0 -p1 -b .sync-brcm-0.6.2.13
|
||||
%patch1 -p1 -b .sync-iscsi
|
||||
%patch2 -p1 -b .update-initscripts-and-docs
|
||||
%patch3 -p1 -b .use-var-for-config
|
||||
%patch4 -p1 -b .use-red-hat-for-name
|
||||
%patch5 -p1 -b .add-libiscsi
|
||||
%patch6 -p1 -b .uip-mgmt
|
||||
%patch7 -p1 -b .dont-use-static
|
||||
%patch8 -p1 -b .log-login-failed
|
||||
%patch9 -p1 -b .remove-the-offload-boot-supported-ifdef
|
||||
%patch10 -p1 -b .libiscsi-partial-offload
|
||||
%patch11 -p1 -b .uio-handle-different-iface_rec
|
||||
%patch12 -p1 -b .brcm-man
|
||||
%patch13 -p1 -b .disable-dsa-code
|
||||
|
||||
%build
|
||||
cd utils/open-isns
|
||||
./configure
|
||||
./configure --with-security=no
|
||||
make OPTFLAGS="%{optflags}"
|
||||
cd ../../
|
||||
make OPTFLAGS="%{optflags}" -C utils/sysdeps
|
||||
@ -208,6 +196,22 @@ fi
|
||||
%{_includedir}/libiscsi.h
|
||||
|
||||
%changelog
|
||||
* Mon Jan 31 2011 Mike Christie <akozumpl@redhat.com> 6.2.0.872.14
|
||||
- 593269 iscsi was built against libcrypto, but was not using the code
|
||||
so this disabled the building of that code.
|
||||
- 599539 document brcm_iscsiuio options in man page.
|
||||
- 599542 document iscsiadm host mode hostno argument.
|
||||
- 631821 iscsi discovery was not incrementing ITT when multiple text
|
||||
commands were sent. This prevented discovery from finding all targets.
|
||||
- 634021 iscsi init script did not shutdown all sessions during system
|
||||
shutdown/reboot causing the host to hang.
|
||||
- 658428 iscsi init script should not shutdown sessions when root is
|
||||
using them and should not fail startup on all iscsiadm login failures.
|
||||
- 635899 sync brcm_iscsiuio to 0.6.2.13 to add support for IPv6, VLAN,
|
||||
57711E, and 57712 hardware.
|
||||
- 640115 fix hang caused due to race in ISCSI_ERR_INVALID_HOST handling.
|
||||
- 640340 fix iscsiadm exit codes.
|
||||
|
||||
* Fri Dec 3 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.13
|
||||
- 442980 libiscsi: reimplement fw discovery so partial devices are used properly.
|
||||
|
||||
|
14
iscsid.init
14
iscsid.init
@ -26,6 +26,7 @@ exec=/sbin/iscsid
|
||||
prog=iscsid
|
||||
config=/etc/iscsi/iscsid.conf
|
||||
lockfile=/var/lock/subsys/$prog
|
||||
iscsi_lockfile=/var/lock/subsys/iscsi
|
||||
|
||||
# FIXME this has a false positive for root on nfs
|
||||
root_is_iscsi() {
|
||||
@ -38,14 +39,17 @@ force_start() {
|
||||
modprobe -q iscsi_tcp
|
||||
modprobe -q ib_iser
|
||||
modprobe -q cxgb3i
|
||||
modprobe -q cxgb4i
|
||||
modprobe -q bnx2i
|
||||
modprobe -q be2iscsi
|
||||
daemon brcm_iscsiuio
|
||||
daemon $prog
|
||||
retval=$?
|
||||
echo
|
||||
[ $retval -eq 0 ] && touch $lockfile
|
||||
return $retval
|
||||
touch $lockfile
|
||||
# a force start could imply the iscsi service is started due to how it
|
||||
# lazy starts. We need to touch the lock file so it is shutdown later
|
||||
touch $iscsi_lockfile
|
||||
}
|
||||
|
||||
use_discoveryd() {
|
||||
@ -82,7 +86,7 @@ stop() {
|
||||
iscsiadm -k 0 2>/dev/null
|
||||
fi
|
||||
|
||||
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|be2iscsi") )
|
||||
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|cxgb4i|be2iscsi") )
|
||||
if [[ -n "${iparams[*]}" ]]; then
|
||||
# We have active sessions, so don't stop iscsid!!
|
||||
echo -n $"Not stopping $prog: iscsi sessions still active"
|
||||
@ -104,8 +108,10 @@ stop() {
|
||||
rmmod cnic 2>/dev/null
|
||||
|
||||
rmmod cxgb3i 2>/dev/null
|
||||
rmmod cxgb4i 2>/dev/null
|
||||
|
||||
modprobe -r be2iscsi 2>/dev/null
|
||||
# a bug in kobject netlink code will cause this to oops
|
||||
# modprobe -r be2iscsi 2>/dev/null
|
||||
|
||||
modprobe -r ib_iser 2>/dev/null
|
||||
modprobe -r iscsi_tcp 2>/dev/null
|
||||
|
@ -49,15 +49,9 @@ start() {
|
||||
# nodes marked node.startup=automatic
|
||||
echo -n $"Starting $prog: "
|
||||
$exec -m node --loginall=automatic 2>&1 > /dev/null | grep iscsiadm
|
||||
|
||||
# <sigh> iscsiadm does not always give a non 0 exit status in case of
|
||||
# error so we grep for any messages to stderr and see those as errors too
|
||||
if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -eq 0 ]; then
|
||||
failure $"Starting $prog"
|
||||
echo
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Ignore return code, because this command attempts to log into
|
||||
# multiple sessions and some sessions could get logged into and
|
||||
# some could be down temporarily.
|
||||
success $"Starting $prog"
|
||||
touch $lockfile
|
||||
echo
|
||||
@ -65,12 +59,30 @@ start() {
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
$exec -m node --logoutall=automatic 2>&1 > /dev/null | grep iscsiadm
|
||||
# Don't turn off iscsi if root is possibly on a iscsi disk.
|
||||
rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
|
||||
if [[ "$rootopts" =~ "_netdev" ]] ; then
|
||||
echo $"Can not shutdown iSCSI. Root is on a iSCSI disk."
|
||||
|
||||
# <sigh> iscsiadm does not always give a non 0 exit status in case of
|
||||
# error so we grep for any messages to stderr and see those as errors too
|
||||
if [ ${PIPESTATUS[0]} -ne 0 -o ${PIPESTATUS[1]} -eq 0 ]; then
|
||||
# Just clean up lock file if this is a system shutdown/reboot.
|
||||
if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
|
||||
rm -f $lockfile
|
||||
fi
|
||||
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n $"Stopping $prog: "
|
||||
|
||||
if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
|
||||
$exec -m node --logoutall=all 2>&1 > /dev/null
|
||||
else
|
||||
$exec -m node --logoutall=automatic 2>&1 > /dev/null
|
||||
fi
|
||||
|
||||
ret=$?
|
||||
# ignore ISCSI_ERR_NO_OBJS_FOUND/21
|
||||
if [[ "$ret" -ne 0 && "$ret" -ne 21 ]]; then
|
||||
failure $"Stopping $prog"
|
||||
echo
|
||||
return 1
|
||||
@ -95,10 +107,20 @@ force_reload() {
|
||||
restart
|
||||
}
|
||||
|
||||
iscsi_sessions_running() {
|
||||
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
|
||||
if [[ -z "${iparams[*]}" ]]; then
|
||||
# no sessions
|
||||
return 2
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
rh_status() {
|
||||
[ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; }
|
||||
|
||||
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i") )
|
||||
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
|
||||
if [[ -z "${iparams[*]}" ]]; then
|
||||
# no sessions
|
||||
echo $"No active sessions"
|
||||
@ -120,7 +142,7 @@ case "$1" in
|
||||
$1
|
||||
;;
|
||||
stop)
|
||||
rh_status_q || exit 0
|
||||
iscsi_sessions_running || exit 0
|
||||
$1
|
||||
;;
|
||||
restart)
|
||||
|
Loading…
Reference in New Issue
Block a user