Resolves: #516444
This commit is contained in:
parent
b791468533
commit
aadf696d1d
@ -1,2 +1,4 @@
|
|||||||
open-iscsi-2.0-870.1.tar.gz
|
open-iscsi-2.0-870.1.tar.gz
|
||||||
open-iscsi-2.0-871.1.1-bnx2i.tar.gz
|
open-iscsi-2.0-871.1.1-bnx2i.tar.gz
|
||||||
|
open-iscsi-2.0-872-rc1.tar.gz
|
||||||
|
open-iscsi-2.0-872-rc1-bnx2i.tar.gz
|
||||||
|
@ -1,54 +1,8 @@
|
|||||||
From 2a2342c706783fc3cfd1dac7710dd8d8de835ebc Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mike Christie <michaelc@cs.wisc.edu>
|
|
||||||
Date: Fri, 15 Jan 2010 03:08:06 -0600
|
|
||||||
Subject: [PATCH] Add userspace libiscsi
|
|
||||||
|
|
||||||
---
|
|
||||||
Makefile | 2 +
|
|
||||||
libiscsi/Makefile | 64 ++
|
|
||||||
libiscsi/libiscsi.c | 562 ++++++++++
|
|
||||||
libiscsi/libiscsi.doxy | 1473 +++++++++++++++++++++++++++
|
|
||||||
libiscsi/libiscsi.h | 343 +++++++
|
|
||||||
libiscsi/pylibiscsi.c | 624 ++++++++++++
|
|
||||||
libiscsi/setup.py | 9 +
|
|
||||||
libiscsi/tests/test_discovery_firmware.c | 53 +
|
|
||||||
libiscsi/tests/test_discovery_sendtargets.c | 60 ++
|
|
||||||
libiscsi/tests/test_get_auth.c | 70 ++
|
|
||||||
libiscsi/tests/test_get_initiator_name.c | 38 +
|
|
||||||
libiscsi/tests/test_get_network_config.c | 45 +
|
|
||||||
libiscsi/tests/test_login.c | 52 +
|
|
||||||
libiscsi/tests/test_logout.c | 51 +
|
|
||||||
libiscsi/tests/test_params.c | 103 ++
|
|
||||||
libiscsi/tests/test_set_auth.c | 58 ++
|
|
||||||
usr/discovery.c | 1 +
|
|
||||||
usr/iscsi_ipc.h | 2 +
|
|
||||||
usr/iscsiadm.c | 3 +-
|
|
||||||
usr/iscsid.c | 10 +-
|
|
||||||
usr/iscsistart.c | 3 +-
|
|
||||||
usr/log.c | 65 +-
|
|
||||||
usr/log.h | 9 +-
|
|
||||||
23 files changed, 3660 insertions(+), 40 deletions(-)
|
|
||||||
create mode 100644 libiscsi/Makefile
|
|
||||||
create mode 100644 libiscsi/libiscsi.c
|
|
||||||
create mode 100644 libiscsi/libiscsi.doxy
|
|
||||||
create mode 100644 libiscsi/libiscsi.h
|
|
||||||
create mode 100644 libiscsi/pylibiscsi.c
|
|
||||||
create mode 100644 libiscsi/setup.py
|
|
||||||
create mode 100644 libiscsi/tests/test_discovery_firmware.c
|
|
||||||
create mode 100644 libiscsi/tests/test_discovery_sendtargets.c
|
|
||||||
create mode 100644 libiscsi/tests/test_get_auth.c
|
|
||||||
create mode 100644 libiscsi/tests/test_get_initiator_name.c
|
|
||||||
create mode 100644 libiscsi/tests/test_get_network_config.c
|
|
||||||
create mode 100644 libiscsi/tests/test_login.c
|
|
||||||
create mode 100644 libiscsi/tests/test_logout.c
|
|
||||||
create mode 100644 libiscsi/tests/test_params.c
|
|
||||||
create mode 100644 libiscsi/tests/test_set_auth.c
|
|
||||||
|
|
||||||
diff --git a/Makefile b/Makefile
|
diff --git a/Makefile b/Makefile
|
||||||
index 7bd1e2f..a02cb96 100644
|
index db460eb..a4d4ce0 100644
|
||||||
--- a/Makefile
|
--- a/Makefile
|
||||||
+++ b/Makefile
|
+++ b/Makefile
|
||||||
@@ -31,6 +31,7 @@ user: ;
|
@@ -32,6 +32,7 @@ user: ;
|
||||||
$(MAKE) -C utils/fwparam_ibft
|
$(MAKE) -C utils/fwparam_ibft
|
||||||
$(MAKE) -C usr
|
$(MAKE) -C usr
|
||||||
$(MAKE) -C utils
|
$(MAKE) -C utils
|
||||||
@ -56,7 +10,7 @@ index 7bd1e2f..a02cb96 100644
|
|||||||
@echo
|
@echo
|
||||||
@echo "Compilation complete Output file"
|
@echo "Compilation complete Output file"
|
||||||
@echo "----------------------------------- ----------------"
|
@echo "----------------------------------- ----------------"
|
||||||
@@ -52,6 +53,7 @@ kernel: force
|
@@ -53,6 +54,7 @@ kernel: force
|
||||||
force: ;
|
force: ;
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@ -66,16 +20,17 @@ index 7bd1e2f..a02cb96 100644
|
|||||||
$(MAKE) -C utils clean
|
$(MAKE) -C utils clean
|
||||||
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
|
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..a9598fa
|
index 0000000..4aeb44f
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libiscsi/Makefile
|
+++ b/libiscsi/Makefile
|
||||||
@@ -0,0 +1,64 @@
|
@@ -0,0 +1,62 @@
|
||||||
+# This Makefile will work only with GNU make.
|
+# This Makefile will work only with GNU make.
|
||||||
+
|
+
|
||||||
+OSNAME=$(shell uname -s)
|
+OSNAME=$(shell uname -s)
|
||||||
+OPTFLAGS ?= -O2 -g
|
+OPTFLAGS ?= -O2 -g
|
||||||
+WARNFLAGS ?= -Wall -Wstrict-prototypes
|
+WARNFLAGS ?= -Wall -Wstrict-prototypes
|
||||||
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
|
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -I../utils/open-isns \
|
||||||
|
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
|
||||||
+LIB = libiscsi.so.0
|
+LIB = libiscsi.so.0
|
||||||
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
|
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
|
||||||
+TESTS += tests/test_login tests/test_logout tests/test_params
|
+TESTS += tests/test_login tests/test_logout tests/test_params
|
||||||
@ -84,8 +39,8 @@ index 0000000..a9598fa
|
|||||||
+
|
+
|
||||||
+COMMON_SRCS = sysdeps.o
|
+COMMON_SRCS = sysdeps.o
|
||||||
+# sources shared between iscsid, iscsiadm and iscsistart
|
+# sources shared between iscsid, iscsiadm and iscsistart
|
||||||
+ISCSI_LIB_SRCS = session_info.o 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
|
+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_ibft_sysfs.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
|
+# sources shared with the userspace utils, note we build these separately
|
||||||
+# to get PIC versions.
|
+# to get PIC versions.
|
||||||
@ -109,19 +64,16 @@ index 0000000..a9598fa
|
|||||||
+ mkdir -p usr-objs
|
+ mkdir -p usr-objs
|
||||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||||
+
|
+
|
||||||
+libuip-objs/%.o: ../offload/libuip/%.c
|
|
||||||
+ mkdir -p libuip-objs
|
|
||||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
|
||||||
+
|
|
||||||
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
||||||
+ mkdir -p fw-objs
|
+ mkdir -p fw-objs
|
||||||
+ $(CC) $(CFLAGS) -c $< -o $@
|
+ $(CC) $(CFLAGS) -c $< -o $@
|
||||||
+
|
+
|
||||||
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
|
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
|
||||||
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@
|
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -shared -Wl,-soname,$(LIB) $^ -o $@
|
||||||
+ ln -s -f $(LIB) libiscsi.so
|
+ ln -s -f $(LIB) libiscsi.so
|
||||||
+
|
+
|
||||||
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
|
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
|
||||||
|
+ $(CC) $(CFLAGS) -L../utils/open-isns -lisns -c $< -o $@
|
||||||
+
|
+
|
||||||
+html: libiscsi.h libiscsi.doxy
|
+html: libiscsi.h libiscsi.doxy
|
||||||
+ doxygen libiscsi.doxy
|
+ doxygen libiscsi.doxy
|
||||||
@ -136,10 +88,10 @@ index 0000000..a9598fa
|
|||||||
+-include .depend ../usr/.depend
|
+-include .depend ../usr/.depend
|
||||||
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
|
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..4324619
|
index 0000000..a9eb0a6
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/libiscsi/libiscsi.c
|
+++ b/libiscsi/libiscsi.c
|
||||||
@@ -0,0 +1,562 @@
|
@@ -0,0 +1,563 @@
|
||||||
+/*
|
+/*
|
||||||
+ * iSCSI Administration library
|
+ * iSCSI Administration library
|
||||||
+ *
|
+ *
|
||||||
@ -173,11 +125,12 @@ index 0000000..4324619
|
|||||||
+#include "sysfs.h"
|
+#include "sysfs.h"
|
||||||
+#include "iscsi_sysfs.h"
|
+#include "iscsi_sysfs.h"
|
||||||
+#include "session_info.h"
|
+#include "session_info.h"
|
||||||
+#include "util.h"
|
+#include "iscsi_util.h"
|
||||||
+#include "sysdeps.h"
|
+#include "sysdeps.h"
|
||||||
+#include "iface.h"
|
+#include "iface.h"
|
||||||
+#include "iscsi_proto.h"
|
+#include "iscsi_proto.h"
|
||||||
+#include "fw_context.h"
|
+#include "fw_context.h"
|
||||||
|
+#include "iscsid_req.h"
|
||||||
+
|
+
|
||||||
+#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
|
+#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
|
||||||
+
|
+
|
||||||
@ -3760,7 +3713,7 @@ index 0000000..a21f888
|
|||||||
+ return rc;
|
+ return rc;
|
||||||
+}
|
+}
|
||||||
diff --git a/usr/discovery.c b/usr/discovery.c
|
diff --git a/usr/discovery.c b/usr/discovery.c
|
||||||
index 9deb6f4..04fa6a2 100644
|
index 381f825..2233de7 100644
|
||||||
--- a/usr/discovery.c
|
--- a/usr/discovery.c
|
||||||
+++ b/usr/discovery.c
|
+++ b/usr/discovery.c
|
||||||
@@ -36,6 +36,7 @@
|
@@ -36,6 +36,7 @@
|
||||||
@ -3783,10 +3736,10 @@ index 74ef948..713914f 100644
|
|||||||
+
|
+
|
||||||
#endif /* ISCSI_IPC_H */
|
#endif /* ISCSI_IPC_H */
|
||||||
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
|
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
|
||||||
index 2f3bfad..a797baf 100644
|
index df55105..1561341 100644
|
||||||
--- a/usr/iscsiadm.c
|
--- a/usr/iscsiadm.c
|
||||||
+++ b/usr/iscsiadm.c
|
+++ b/usr/iscsiadm.c
|
||||||
@@ -1722,8 +1722,7 @@ main(int argc, char **argv)
|
@@ -1495,8 +1495,7 @@ main(int argc, char **argv)
|
||||||
umask(0177);
|
umask(0177);
|
||||||
|
|
||||||
/* enable stdout logging */
|
/* enable stdout logging */
|
||||||
@ -3797,27 +3750,27 @@ index 2f3bfad..a797baf 100644
|
|||||||
|
|
||||||
optopt = 0;
|
optopt = 0;
|
||||||
diff --git a/usr/iscsid.c b/usr/iscsid.c
|
diff --git a/usr/iscsid.c b/usr/iscsid.c
|
||||||
index bfcca6e..ee68f6f 100644
|
index fcb5eb3..8238e2b 100644
|
||||||
--- a/usr/iscsid.c
|
--- a/usr/iscsid.c
|
||||||
+++ b/usr/iscsid.c
|
+++ b/usr/iscsid.c
|
||||||
@@ -52,6 +52,7 @@ struct iscsi_daemon_config *dconfig = &daemon_config;
|
@@ -57,6 +57,7 @@ static char program_name[] = "iscsid";
|
||||||
static char program_name[] = "iscsid";
|
|
||||||
int control_fd, mgmt_ipc_fd;
|
int control_fd, mgmt_ipc_fd;
|
||||||
static pid_t log_pid;
|
static pid_t log_pid;
|
||||||
|
static gid_t gid;
|
||||||
+static int daemonize = 1;
|
+static int daemonize = 1;
|
||||||
|
|
||||||
static struct option const long_options[] = {
|
static struct option const long_options[] = {
|
||||||
{"config", required_argument, NULL, 'c'},
|
{"config", required_argument, NULL, 'c'},
|
||||||
@@ -294,7 +295,7 @@ static void iscsid_exit(void)
|
@@ -293,7 +294,7 @@ static void iscsid_shutdown(void)
|
||||||
static void iscsid_shutdown(void)
|
log_debug(7, "cleaned up pid %d", pid);
|
||||||
{
|
|
||||||
log_warning("iscsid shutting down.");
|
log_warning("iscsid shutting down.");
|
||||||
- if (log_daemon && log_pid >= 0) {
|
- if (log_daemon && log_pid >= 0) {
|
||||||
+ if (daemonize && log_pid >= 0) {
|
+ if (daemonize && log_pid >= 0) {
|
||||||
log_debug(1, "daemon stopping");
|
log_debug(1, "daemon stopping");
|
||||||
log_close(log_pid);
|
log_close(log_pid);
|
||||||
fprintf(stderr, "done done\n");
|
}
|
||||||
@@ -360,7 +361,7 @@ int main(int argc, char *argv[])
|
@@ -356,7 +357,7 @@ int main(int argc, char *argv[])
|
||||||
initiatorname_file = optarg;
|
initiatorname_file = optarg;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -3826,7 +3779,7 @@ index bfcca6e..ee68f6f 100644
|
|||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
log_level = atoi(optarg);
|
log_level = atoi(optarg);
|
||||||
@@ -388,7 +389,8 @@ int main(int argc, char *argv[])
|
@@ -384,7 +385,8 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize logger */
|
/* initialize logger */
|
||||||
@ -3836,7 +3789,7 @@ index bfcca6e..ee68f6f 100644
|
|||||||
if (log_pid < 0)
|
if (log_pid < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
@@ -420,7 +422,7 @@ int main(int argc, char *argv[])
|
@@ -411,7 +413,7 @@ int main(int argc, char *argv[])
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3846,10 +3799,10 @@ index bfcca6e..ee68f6f 100644
|
|||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
diff --git a/usr/iscsistart.c b/usr/iscsistart.c
|
diff --git a/usr/iscsistart.c b/usr/iscsistart.c
|
||||||
index 2080066..e2e4ce2 100644
|
index 94a9601..6e4c3dc 100644
|
||||||
--- a/usr/iscsistart.c
|
--- a/usr/iscsistart.c
|
||||||
+++ b/usr/iscsistart.c
|
+++ b/usr/iscsistart.c
|
||||||
@@ -255,8 +255,7 @@ int main(int argc, char *argv[])
|
@@ -256,8 +256,7 @@ int main(int argc, char *argv[])
|
||||||
sigaction(SIGINT, &sa_new, &sa_old );
|
sigaction(SIGINT, &sa_new, &sa_old );
|
||||||
|
|
||||||
/* initialize logger */
|
/* initialize logger */
|
||||||
@ -3860,7 +3813,7 @@ index 2080066..e2e4ce2 100644
|
|||||||
sysfs_init();
|
sysfs_init();
|
||||||
if (iscsi_sysfs_check_class_version())
|
if (iscsi_sysfs_check_class_version())
|
||||||
diff --git a/usr/log.c b/usr/log.c
|
diff --git a/usr/log.c b/usr/log.c
|
||||||
index 908aac1..017cf9d 100644
|
index 7dd6de8..6f276c4 100644
|
||||||
--- a/usr/log.c
|
--- a/usr/log.c
|
||||||
+++ b/usr/log.c
|
+++ b/usr/log.c
|
||||||
@@ -32,10 +32,11 @@
|
@@ -32,10 +32,11 @@
|
||||||
@ -3999,7 +3952,7 @@ index 908aac1..017cf9d 100644
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
diff --git a/usr/log.h b/usr/log.h
|
diff --git a/usr/log.h b/usr/log.h
|
||||||
index 23b388e..af4019b 100644
|
index 8af7986..c3b3955 100644
|
||||||
--- a/usr/log.h
|
--- a/usr/log.h
|
||||||
+++ b/usr/log.h
|
+++ b/usr/log.h
|
||||||
@@ -26,6 +26,7 @@
|
@@ -26,6 +26,7 @@
|
||||||
@ -4007,10 +3960,10 @@ index 23b388e..af4019b 100644
|
|||||||
#define LOG_H
|
#define LOG_H
|
||||||
|
|
||||||
+#include <stdarg.h>
|
+#include <stdarg.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include "iscsid.h"
|
#include "iscsid.h"
|
||||||
|
|
||||||
union semun {
|
@@ -40,7 +41,6 @@ union semun {
|
||||||
@@ -39,7 +40,6 @@ union semun {
|
|
||||||
#define DEFAULT_AREA_SIZE 16384
|
#define DEFAULT_AREA_SIZE 16384
|
||||||
#define MAX_MSG_SIZE 256
|
#define MAX_MSG_SIZE 256
|
||||||
|
|
||||||
@ -4018,7 +3971,7 @@ index 23b388e..af4019b 100644
|
|||||||
extern int log_level;
|
extern int log_level;
|
||||||
|
|
||||||
struct logmsg {
|
struct logmsg {
|
||||||
@@ -65,7 +65,9 @@ struct logarea {
|
@@ -66,7 +66,9 @@ struct logarea {
|
||||||
|
|
||||||
struct logarea *la;
|
struct logarea *la;
|
||||||
|
|
||||||
@ -4029,7 +3982,7 @@ index 23b388e..af4019b 100644
|
|||||||
extern void log_close (pid_t pid);
|
extern void log_close (pid_t pid);
|
||||||
extern void dump_logmsg (void *);
|
extern void dump_logmsg (void *);
|
||||||
extern void log_warning(const char *fmt, ...)
|
extern void log_warning(const char *fmt, ...)
|
||||||
@@ -75,4 +77,7 @@ extern void log_error(const char *fmt, ...)
|
@@ -76,4 +78,7 @@ extern void log_error(const char *fmt, ...)
|
||||||
extern void log_debug(int level, const char *fmt, ...)
|
extern void log_debug(int level, const char *fmt, ...)
|
||||||
__attribute__ ((format (printf, 2, 3)));
|
__attribute__ ((format (printf, 2, 3)));
|
||||||
|
|
||||||
@ -4038,5 +3991,5 @@ index 23b388e..af4019b 100644
|
|||||||
+
|
+
|
||||||
#endif /* LOG_H */
|
#endif /* LOG_H */
|
||||||
--
|
--
|
||||||
1.6.5.2
|
1.6.6.1
|
||||||
|
|
||||||
|
74
iscsi-initiator-utils-disable-isns-for-lib.patch
Normal file
74
iscsi-initiator-utils-disable-isns-for-lib.patch
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
|
||||||
|
index 4aeb44f..a91d6b8 100644
|
||||||
|
--- a/libiscsi/Makefile
|
||||||
|
+++ b/libiscsi/Makefile
|
||||||
|
@@ -3,7 +3,7 @@
|
||||||
|
OSNAME=$(shell uname -s)
|
||||||
|
OPTFLAGS ?= -O2 -g
|
||||||
|
WARNFLAGS ?= -Wall -Wstrict-prototypes
|
||||||
|
-CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr -I../utils/open-isns \
|
||||||
|
+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
|
||||||
|
@@ -43,11 +43,10 @@ fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
||||||
|
$(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 $@
|
||||||
|
+ $(CC) $(CFLAGS) -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
|
||||||
|
diff --git a/usr/Makefile b/usr/Makefile
|
||||||
|
index 8e505bf..13a60f9 100644
|
||||||
|
--- a/usr/Makefile
|
||||||
|
+++ b/usr/Makefile
|
||||||
|
@@ -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
|
||||||
|
diff --git a/usr/discovery.c b/usr/discovery.c
|
||||||
|
index 2233de7..02c6f25 100644
|
||||||
|
--- a/usr/discovery.c
|
||||||
|
+++ b/usr/discovery.c
|
||||||
|
@@ -45,9 +45,11 @@
|
||||||
|
#include "iscsid_req.h"
|
||||||
|
#include "iscsi_util.h"
|
||||||
|
/* libisns includes */
|
||||||
|
+#ifdef ISNS_ENABLE
|
||||||
|
#include "isns.h"
|
||||||
|
#include "paths.h"
|
||||||
|
#include "message.h"
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#ifdef SLP_ENABLE
|
||||||
|
#include "iscsi-slp-discovery.h"
|
||||||
|
@@ -94,6 +96,7 @@ static int request_initiator_name(void)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#ifdef ISNS_ENABLE
|
||||||
|
void discovery_isns_free_servername(void)
|
||||||
|
{
|
||||||
|
if (isns_config.ic_server_name)
|
||||||
|
@@ -367,6 +370,7 @@ retry:
|
||||||
|
discovery_isns_free_servername();
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
int discovery_fw(void *data, struct iface_rec *iface,
|
||||||
|
struct list_head *rec_list)
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
696
iscsi-initiator-utils-fw-boot.patch
Normal file
696
iscsi-initiator-utils-fw-boot.patch
Normal file
@ -0,0 +1,696 @@
|
|||||||
|
diff --git a/include/fw_context.h b/include/fw_context.h
|
||||||
|
index abdff42..770b41a 100644
|
||||||
|
--- a/include/fw_context.h
|
||||||
|
+++ b/include/fw_context.h
|
||||||
|
@@ -54,6 +54,8 @@ struct boot_context {
|
||||||
|
char mask[18];
|
||||||
|
char lun[17];
|
||||||
|
char vlan[15];
|
||||||
|
+
|
||||||
|
+ char scsi_host_name[64];
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int fw_get_entry(struct boot_context *context);
|
||||||
|
diff --git a/usr/iface.c b/usr/iface.c
|
||||||
|
index 27b59d0..9c74117 100644
|
||||||
|
--- a/usr/iface.c
|
||||||
|
+++ b/usr/iface.c
|
||||||
|
@@ -778,31 +778,62 @@ void iface_link_ifaces(struct list_head *ifaces)
|
||||||
|
iface_for_each_iface(ifaces, 1, &nr_found, iface_link);
|
||||||
|
}
|
||||||
|
|
||||||
|
-void iface_setup_from_boot_context(struct iface_rec *iface,
|
||||||
|
+/**
|
||||||
|
+ * iface_setup_from_boot_context - setup iface from boot context info
|
||||||
|
+ * @iface: iface t setup
|
||||||
|
+ * @context: boot context info
|
||||||
|
+ *
|
||||||
|
+ * Returns 1 if setup for offload.
|
||||||
|
+ */
|
||||||
|
+int iface_setup_from_boot_context(struct iface_rec *iface,
|
||||||
|
struct boot_context *context)
|
||||||
|
{
|
||||||
|
if (strlen(context->initiatorname))
|
||||||
|
strlcpy(iface->iname, context->initiatorname,
|
||||||
|
sizeof(iface->iname));
|
||||||
|
|
||||||
|
- if (strlen(context->iface)) {
|
||||||
|
- if (!net_get_transport_name_from_netdev(context->iface,
|
||||||
|
- iface->transport_name)) {
|
||||||
|
- /* set up for access through offload card */
|
||||||
|
- memset(iface->name, 0, sizeof(iface->name));
|
||||||
|
- snprintf(iface->name, sizeof(iface->name),
|
||||||
|
- "%s.%s", iface->transport_name,
|
||||||
|
- context->mac);
|
||||||
|
-
|
||||||
|
- strlcpy(iface->netdev, context->iface,
|
||||||
|
- sizeof(iface->netdev));
|
||||||
|
- strlcpy(iface->hwaddress, context->mac,
|
||||||
|
- sizeof(iface->hwaddress));
|
||||||
|
- strlcpy(iface->ipaddress, context->ipaddr,
|
||||||
|
- sizeof(iface->ipaddress));
|
||||||
|
+ if (strlen(context->scsi_host_name)) {
|
||||||
|
+ struct iscsi_transport *t;
|
||||||
|
+ uint32_t hostno;
|
||||||
|
+
|
||||||
|
+ if (sscanf(context->scsi_host_name, "iscsi_host%u", &hostno) != 1) {
|
||||||
|
+ log_error("Could not parse %s's host no.",
|
||||||
|
+ context->scsi_host_name);
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
- }
|
||||||
|
+ t = iscsi_sysfs_get_transport_by_hba(hostno);
|
||||||
|
+ if (!t) {
|
||||||
|
+ log_error("Could not get transport for %s. "
|
||||||
|
+ "Make sure the iSCSI driver is loaded.",
|
||||||
|
+ context->scsi_host_name);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ log_debug(3, "boot context has %s transport %s",
|
||||||
|
+ context->scsi_host_name, t->name);
|
||||||
|
+ strcpy(iface->transport_name, t->name);
|
||||||
|
+ } else if (strlen(context->iface) &&
|
||||||
|
+ (!net_get_transport_name_from_netdev(context->iface,
|
||||||
|
+ iface->transport_name))) {
|
||||||
|
+ log_debug(3, "boot context has netdev %s",
|
||||||
|
+ context->iface);
|
||||||
|
+ strlcpy(iface->netdev, context->iface,
|
||||||
|
+ sizeof(iface->netdev));
|
||||||
|
+ } else
|
||||||
|
+ return 0;
|
||||||
|
+ /*
|
||||||
|
+ * set up for access through a offload card.
|
||||||
|
+ */
|
||||||
|
+ memset(iface->name, 0, sizeof(iface->name));
|
||||||
|
+ snprintf(iface->name, sizeof(iface->name), "%s.%s",
|
||||||
|
+ iface->transport_name, context->mac);
|
||||||
|
+
|
||||||
|
+ strlcpy(iface->hwaddress, context->mac,
|
||||||
|
+ sizeof(iface->hwaddress));
|
||||||
|
+ strlcpy(iface->ipaddress, context->ipaddr,
|
||||||
|
+ sizeof(iface->ipaddress));
|
||||||
|
log_debug(1, "iface " iface_fmt "\n", iface_str(iface));
|
||||||
|
+ return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -817,32 +848,24 @@ void iface_setup_from_boot_context(struct iface_rec *iface,
|
||||||
|
int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces,
|
||||||
|
struct list_head *targets)
|
||||||
|
{
|
||||||
|
- char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
|
||||||
|
- char iface_name[ISCSI_MAX_IFACE_LEN];
|
||||||
|
struct boot_context *context;
|
||||||
|
struct iface_rec *iface, *tmp_iface;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
list_for_each_entry(context, targets, list) {
|
||||||
|
- memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN);
|
||||||
|
-
|
||||||
|
- if (net_get_transport_name_from_netdev(context->iface,
|
||||||
|
- transport_name))
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- /* offload + ibft support */
|
||||||
|
- memset(iface_name, 0, ISCSI_MAX_IFACE_LEN);
|
||||||
|
- snprintf(iface_name, ISCSI_MAX_IFACE_LEN,
|
||||||
|
- "%s.%s", transport_name, context->mac);
|
||||||
|
-
|
||||||
|
rc = 0;
|
||||||
|
- iface = iface_alloc(iface_name, &rc);
|
||||||
|
+ /* use dummy name. If valid it will get overwritten below */
|
||||||
|
+ iface = iface_alloc(DEFAULT_IFACENAME, &rc);
|
||||||
|
if (!iface) {
|
||||||
|
log_error("Could not setup iface %s for boot\n",
|
||||||
|
- iface_name);
|
||||||
|
+ context->iface);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
- iface_setup_from_boot_context(iface, context);
|
||||||
|
+ if (!iface_setup_from_boot_context(iface, context)) {
|
||||||
|
+ /* no offload so forget it */
|
||||||
|
+ free(iface);
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
rc = iface_conf_write(iface);
|
||||||
|
if (rc) {
|
||||||
|
diff --git a/usr/iface.h b/usr/iface.h
|
||||||
|
index f948686..9f6d47e 100644
|
||||||
|
--- a/usr/iface.h
|
||||||
|
+++ b/usr/iface.h
|
||||||
|
@@ -50,7 +50,7 @@ extern int iface_conf_write(struct iface_rec *iface);
|
||||||
|
extern int iface_conf_delete(struct iface_rec *iface);
|
||||||
|
extern int iface_is_valid(struct iface_rec *iface);
|
||||||
|
extern void iface_link_ifaces(struct list_head *ifaces);
|
||||||
|
-extern void iface_setup_from_boot_context(struct iface_rec *iface,
|
||||||
|
+extern int iface_setup_from_boot_context(struct iface_rec *iface,
|
||||||
|
struct boot_context *context);
|
||||||
|
extern int iface_create_ifaces_from_boot_contexts(struct list_head *ifaces,
|
||||||
|
struct list_head *targets);
|
||||||
|
diff --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
|
||||||
|
index b9e7988..ca07b76 100644
|
||||||
|
--- a/utils/fwparam_ibft/Makefile
|
||||||
|
+++ b/utils/fwparam_ibft/Makefile
|
||||||
|
@@ -22,7 +22,7 @@
|
||||||
|
#
|
||||||
|
|
||||||
|
SYSDEPS_OBJS = $(wildcard ../sysdeps/*.o)
|
||||||
|
-OBJS := fw_entry.o fwparam_ibft_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
|
||||||
|
+OBJS := fw_entry.o fwparam_sysfs.o $(SYSDEPS_OBJS) ../../usr/iscsi_net_util.o
|
||||||
|
OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
|
||||||
|
CLEANFILES = $(OBJS) *.output *~
|
||||||
|
|
||||||
|
diff --git a/utils/fwparam_ibft/fw_entry.c b/utils/fwparam_ibft/fw_entry.c
|
||||||
|
index ae5d34a..bbdb6d2 100644
|
||||||
|
--- a/utils/fwparam_ibft/fw_entry.c
|
||||||
|
+++ b/utils/fwparam_ibft/fw_entry.c
|
||||||
|
@@ -102,8 +102,7 @@ int fw_get_entry(struct boot_context *context)
|
||||||
|
|
||||||
|
ret = fwparam_ppc_boot_info(context);
|
||||||
|
if (ret)
|
||||||
|
- ret = fwparam_ibft_sysfs_boot_info(context);
|
||||||
|
-
|
||||||
|
+ ret = fwparam_sysfs_boot_info(context);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -124,8 +123,7 @@ int fw_get_targets(struct list_head *list)
|
||||||
|
|
||||||
|
ret = fwparam_ppc_get_targets(list);
|
||||||
|
if (ret)
|
||||||
|
- ret = fwparam_ibft_sysfs_get_targets(list);
|
||||||
|
-
|
||||||
|
+ ret = fwparam_sysfs_get_targets(list);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/utils/fwparam_ibft/fwparam.h b/utils/fwparam_ibft/fwparam.h
|
||||||
|
index a79213b..32e4961 100644
|
||||||
|
--- a/utils/fwparam_ibft/fwparam.h
|
||||||
|
+++ b/utils/fwparam_ibft/fwparam.h
|
||||||
|
@@ -24,8 +24,8 @@
|
||||||
|
|
||||||
|
struct boot_context;
|
||||||
|
|
||||||
|
-int fwparam_ibft_sysfs_boot_info(struct boot_context *context);
|
||||||
|
-int fwparam_ibft_sysfs_get_targets(struct list_head *list);
|
||||||
|
+int fwparam_sysfs_boot_info(struct boot_context *context);
|
||||||
|
+int fwparam_sysfs_get_targets(struct list_head *list);
|
||||||
|
int fwparam_ppc_boot_info(struct boot_context *context);
|
||||||
|
int fwparam_ppc_get_targets(struct list_head *list);
|
||||||
|
|
||||||
|
diff --git a/utils/fwparam_ibft/fwparam_sysfs.c b/utils/fwparam_ibft/fwparam_sysfs.c
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..9b73d1a
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/utils/fwparam_ibft/fwparam_sysfs.c
|
||||||
|
@@ -0,0 +1,484 @@
|
||||||
|
+/*
|
||||||
|
+ * Copyright (C) IBM Corporation. 2007
|
||||||
|
+ * Author: Konrad Rzeszutek <konradr@linux.vnet.ibm.com>
|
||||||
|
+ * Copyright (C) Red Hat, Inc. All rights reserved. 2008 - 2010
|
||||||
|
+ * Copyright (C) Mike Christie 2008 - 2010
|
||||||
|
+ *
|
||||||
|
+ * This program is free software: you can redistribute it and/or modify
|
||||||
|
+ * it under the terms of the GNU General Public License as published by
|
||||||
|
+ * the Free Software Foundation, either version 2 of the License, or
|
||||||
|
+ * (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * This program is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ * GNU General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU General Public License
|
||||||
|
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#define _XOPEN_SOURCE 500
|
||||||
|
+#define _SVID_SOURCE
|
||||||
|
+#include <ftw.h>
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <stdlib.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <fcntl.h>
|
||||||
|
+#include <errno.h>
|
||||||
|
+#include <dirent.h>
|
||||||
|
+#include <sys/types.h>
|
||||||
|
+#include <sys/stat.h>
|
||||||
|
+
|
||||||
|
+#include "sysfs.h"
|
||||||
|
+#include "fw_context.h"
|
||||||
|
+#include "fwparam.h"
|
||||||
|
+#include "sysdeps.h"
|
||||||
|
+#include "iscsi_net_util.h"
|
||||||
|
+
|
||||||
|
+#define ISCSI_BOOT_MAX 255
|
||||||
|
+#define IBFT_SYSFS_ROOT "/sys/firmware/ibft/"
|
||||||
|
+#define IBFT_SUBSYS "ibft"
|
||||||
|
+
|
||||||
|
+#define ISCSI_LLD_ROOT "/sys/firmware/"
|
||||||
|
+#define ISCSI_LLD_SUBSYS_PREFIX "iscsi_host"
|
||||||
|
+
|
||||||
|
+static char *target_list[ISCSI_BOOT_MAX];
|
||||||
|
+static char *nic_list[ISCSI_BOOT_MAX];
|
||||||
|
+static int nic_cnt;
|
||||||
|
+static int tgt_cnt;
|
||||||
|
+
|
||||||
|
+static int file_exist(const char *file)
|
||||||
|
+{
|
||||||
|
+ struct stat bootpath_stat;
|
||||||
|
+
|
||||||
|
+ return !stat(file, &bootpath_stat);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Finds the etherrnetX and targetX under the sysfs directory.
|
||||||
|
+ */
|
||||||
|
+static int find_sysfs_dirs(const char *fpath, const struct stat *sb,
|
||||||
|
+ int tflag, struct FTW *ftw)
|
||||||
|
+{
|
||||||
|
+ if (tflag == FTW_D && (strstr(fpath + ftw->base, "target"))) {
|
||||||
|
+ if (tgt_cnt == ISCSI_BOOT_MAX) {
|
||||||
|
+ printf("Too many targets found in iSCSI boot data."
|
||||||
|
+ "Max number of targets %d\n", ISCSI_BOOT_MAX);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ target_list[tgt_cnt++] = strdup(strstr(fpath, "target"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (tflag == FTW_D && (strstr(fpath + ftw->base, "ethernet"))) {
|
||||||
|
+ if (nic_cnt == ISCSI_BOOT_MAX) {
|
||||||
|
+ printf("Too many nics found in iSCSI boot data."
|
||||||
|
+ "Max number of nics %d\n", ISCSI_BOOT_MAX);
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ nic_list[nic_cnt++] = strdup(strstr(fpath, "ethernet"));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int get_iface_from_device(char *id, struct boot_context *context)
|
||||||
|
+{
|
||||||
|
+ char dev_dir[FILENAMESZ];
|
||||||
|
+ int rc = ENODEV;
|
||||||
|
+ DIR *dirfd;
|
||||||
|
+ struct dirent *dent;
|
||||||
|
+
|
||||||
|
+ memset(dev_dir, 0, FILENAMESZ);
|
||||||
|
+ snprintf(dev_dir, FILENAMESZ, IBFT_SYSFS_ROOT"/%s/device", id);
|
||||||
|
+
|
||||||
|
+ if (!file_exist(dev_dir))
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+ dirfd = opendir(dev_dir);
|
||||||
|
+ if (!dirfd)
|
||||||
|
+ return errno;
|
||||||
|
+
|
||||||
|
+ while ((dent = readdir(dirfd))) {
|
||||||
|
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..") ||
|
||||||
|
+ strncmp(dent->d_name, "net:", 4))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (!strncmp(dent->d_name, "net:", 4)) {
|
||||||
|
+ if ((strlen(dent->d_name) - 4) >
|
||||||
|
+ (sizeof(context->iface) - 1)) {
|
||||||
|
+ rc = EINVAL;
|
||||||
|
+ printf("Net device %s too big for iface "
|
||||||
|
+ "buffer.\n", dent->d_name);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (sscanf(dent->d_name, "net:%s", context->iface) != 1)
|
||||||
|
+ rc = EINVAL;
|
||||||
|
+ rc = 0;
|
||||||
|
+ break;
|
||||||
|
+ } else {
|
||||||
|
+ printf("Could not read ethernet to net link.\n");
|
||||||
|
+ rc = EOPNOTSUPP;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ closedir(dirfd);
|
||||||
|
+
|
||||||
|
+ if (rc != ENODEV)
|
||||||
|
+ return rc;
|
||||||
|
+
|
||||||
|
+ /* If not found try again with newer kernel networkdev sysfs layout */
|
||||||
|
+ strlcat(dev_dir, "/net", FILENAMESZ);
|
||||||
|
+
|
||||||
|
+ if (!file_exist(dev_dir))
|
||||||
|
+ return rc;
|
||||||
|
+
|
||||||
|
+ dirfd = opendir(dev_dir);
|
||||||
|
+ if (!dirfd)
|
||||||
|
+ return errno;
|
||||||
|
+
|
||||||
|
+ while ((dent = readdir(dirfd))) {
|
||||||
|
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ /* Take the first "regular" directory entry */
|
||||||
|
+ if (strlen(dent->d_name) > (sizeof(context->iface) - 1)) {
|
||||||
|
+ rc = EINVAL;
|
||||||
|
+ printf("Net device %s too big for iface buffer.\n",
|
||||||
|
+ dent->d_name);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ strcpy(context->iface, dent->d_name);
|
||||||
|
+ rc = 0;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ closedir(dirfd);
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Routines to fill in the context values.
|
||||||
|
+ */
|
||||||
|
+static int fill_nic_context(char *subsys, char *id,
|
||||||
|
+ struct boot_context *context)
|
||||||
|
+{
|
||||||
|
+ int rc;
|
||||||
|
+
|
||||||
|
+ rc = sysfs_get_str(id, subsys, "mac", context->mac,
|
||||||
|
+ sizeof(context->mac));
|
||||||
|
+ if (rc)
|
||||||
|
+ return rc;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Some offload cards like bnx2i use different MACs for the net and
|
||||||
|
+ * iscsi functions, so we have to follow the sysfs links.
|
||||||
|
+ *
|
||||||
|
+ * Other ibft implementations may not be tied to a pci function,
|
||||||
|
+ * so there will not be any device/net link, so we drop down to
|
||||||
|
+ * the MAC matching.
|
||||||
|
+ *
|
||||||
|
+ * And finally, some cards like be2iscsi and qla4xxx do not have
|
||||||
|
+ * any linux network subsys representation. These hosts will
|
||||||
|
+ * not have the ibft subsys. Instead the subsys is the scsi host
|
||||||
|
+ * number.
|
||||||
|
+ */
|
||||||
|
+ if (!strcmp(IBFT_SUBSYS, subsys)) {
|
||||||
|
+ rc = get_iface_from_device(id, context);
|
||||||
|
+ if (rc) {
|
||||||
|
+ rc = net_get_netdev_from_hwaddress(context->mac,
|
||||||
|
+ context->iface);
|
||||||
|
+ if (rc)
|
||||||
|
+ return rc;
|
||||||
|
+ }
|
||||||
|
+ } else
|
||||||
|
+ strlcpy(context->scsi_host_name, subsys,
|
||||||
|
+ sizeof(context->scsi_host_name));
|
||||||
|
+
|
||||||
|
+ sysfs_get_str(id, subsys, "ip-addr", context->ipaddr,
|
||||||
|
+ sizeof(context->ipaddr));
|
||||||
|
+ sysfs_get_str(id, subsys, "vlan", context->vlan,
|
||||||
|
+ sizeof(context->vlan));
|
||||||
|
+ sysfs_get_str(id, subsys, "subnet-mask", context->mask,
|
||||||
|
+ sizeof(context->mask));
|
||||||
|
+ sysfs_get_str(id, subsys, "gateway", context->gateway,
|
||||||
|
+ sizeof(context->gateway));
|
||||||
|
+ sysfs_get_str(id, subsys, "primary-dns", context->primary_dns,
|
||||||
|
+ sizeof(context->primary_dns));
|
||||||
|
+ sysfs_get_str(id, subsys, "secondary-dns", context->secondary_dns,
|
||||||
|
+ sizeof(context->secondary_dns));
|
||||||
|
+ sysfs_get_str(id, subsys, "dhcp", context->dhcp,
|
||||||
|
+ sizeof(context->dhcp));
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void fill_initiator_context(char *subsys, struct boot_context *context)
|
||||||
|
+{
|
||||||
|
+ sysfs_get_str("initiator", subsys, "initiator-name",
|
||||||
|
+ context->initiatorname,
|
||||||
|
+ sizeof(context->initiatorname));
|
||||||
|
+ sysfs_get_str("initiator", subsys, "isid", context->isid,
|
||||||
|
+ sizeof(context->isid));
|
||||||
|
+}
|
||||||
|
+static int fill_tgt_context(char *subsys, char *id,
|
||||||
|
+ struct boot_context *context)
|
||||||
|
+{
|
||||||
|
+ int rc;
|
||||||
|
+
|
||||||
|
+ rc = sysfs_get_str(id, subsys, "target-name", context->targetname,
|
||||||
|
+ sizeof(context->targetname));
|
||||||
|
+ if (rc)
|
||||||
|
+ return rc;
|
||||||
|
+
|
||||||
|
+ rc = sysfs_get_str(id, subsys, "ip-addr", context->target_ipaddr,
|
||||||
|
+ sizeof(context->target_ipaddr));
|
||||||
|
+ if (rc)
|
||||||
|
+ return rc;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * We can live without the rest of they do not exist. If we
|
||||||
|
+ * failed to get them we will figure it out when we login.
|
||||||
|
+ */
|
||||||
|
+ if (sysfs_get_int(id, subsys, "port", &context->target_port))
|
||||||
|
+ context->target_port = ISCSI_LISTEN_PORT;
|
||||||
|
+
|
||||||
|
+ sysfs_get_str(id, subsys, "lun", context->lun,
|
||||||
|
+ sizeof(context->lun));
|
||||||
|
+ sysfs_get_str(id, subsys, "chap-name", context->chap_name,
|
||||||
|
+ sizeof(context->chap_name));
|
||||||
|
+ sysfs_get_str(id, subsys, "chap-secret", context->chap_password,
|
||||||
|
+ sizeof(context->chap_password));
|
||||||
|
+ sysfs_get_str(id, subsys, "rev-chap-name", context->chap_name_in,
|
||||||
|
+ sizeof(context->chap_name_in));
|
||||||
|
+ sysfs_get_str(id, subsys, "rev-chap-name-secret",
|
||||||
|
+ context->chap_password_in,
|
||||||
|
+ sizeof(context->chap_password_in));
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+#define IBFT_SYSFS_FLAG_FW_SEL_BOOT 2
|
||||||
|
+
|
||||||
|
+static int find_boot_flag(char *subsys, char *list[], ssize_t size,
|
||||||
|
+ int *boot_idx)
|
||||||
|
+{
|
||||||
|
+ int rc = ENODEV;
|
||||||
|
+ int i, flag = 0;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < size; i++, flag = -1) {
|
||||||
|
+ rc = sysfs_get_int(list[i], subsys, "flags", &flag);
|
||||||
|
+ if (rc)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (flag & IBFT_SYSFS_FLAG_FW_SEL_BOOT) {
|
||||||
|
+ *boot_idx = i;
|
||||||
|
+ rc = 0;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ rc = ENODEV;
|
||||||
|
+ flag = 0;
|
||||||
|
+
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void deallocate_lists(void)
|
||||||
|
+{
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < nic_cnt; i++)
|
||||||
|
+ free(nic_list[i]);
|
||||||
|
+
|
||||||
|
+ nic_cnt = 0;
|
||||||
|
+ for (i = 0; i < tgt_cnt; i++)
|
||||||
|
+ free(target_list[i]);
|
||||||
|
+
|
||||||
|
+ tgt_cnt = 0;
|
||||||
|
+
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int get_boot_info(struct boot_context *context, char *rootdir,
|
||||||
|
+ char *subsys)
|
||||||
|
+{
|
||||||
|
+ char initiator_dir[FILENAMESZ];
|
||||||
|
+ int rc = ENODEV;
|
||||||
|
+ int nic_idx = -1, tgt_idx = -1;
|
||||||
|
+
|
||||||
|
+ memset(&initiator_dir, 0 , FILENAMESZ);
|
||||||
|
+ snprintf(initiator_dir, FILENAMESZ, "%sinitiator", rootdir);
|
||||||
|
+
|
||||||
|
+ nic_cnt = 0;
|
||||||
|
+ tgt_cnt = 0;
|
||||||
|
+ if (file_exist(initiator_dir)) {
|
||||||
|
+ /* Find the target's and the ethernet's */
|
||||||
|
+ rc = nftw(rootdir, find_sysfs_dirs, 20, 1);
|
||||||
|
+
|
||||||
|
+ /* Find wihch target and which ethernet have
|
||||||
|
+ the boot flag set. */
|
||||||
|
+ rc = find_boot_flag(subsys, nic_list, nic_cnt, &nic_idx);
|
||||||
|
+ if (rc)
|
||||||
|
+ goto free;
|
||||||
|
+
|
||||||
|
+ rc = find_boot_flag(subsys, target_list, tgt_cnt, &tgt_idx);
|
||||||
|
+ if (rc)
|
||||||
|
+ goto free;
|
||||||
|
+
|
||||||
|
+ /* Fill in the context values */
|
||||||
|
+ rc = fill_nic_context(subsys, nic_list[nic_idx], context);
|
||||||
|
+ rc |= fill_tgt_context(subsys, target_list[tgt_idx], context);
|
||||||
|
+ fill_initiator_context(subsys, context);
|
||||||
|
+ }
|
||||||
|
+free:
|
||||||
|
+ deallocate_lists();
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int fwparam_sysfs_boot_info(struct boot_context *context)
|
||||||
|
+{
|
||||||
|
+ struct dirent *dent;
|
||||||
|
+ DIR *dirfd;
|
||||||
|
+ int rc = 0;
|
||||||
|
+
|
||||||
|
+ if (!get_boot_info(context, IBFT_SYSFS_ROOT, IBFT_SUBSYS))
|
||||||
|
+ return 0;
|
||||||
|
+ /*
|
||||||
|
+ * We could have multiple iscsi llds and each lld could have
|
||||||
|
+ * multiple targets/ethernet ports
|
||||||
|
+ */
|
||||||
|
+ dirfd = opendir(ISCSI_LLD_ROOT);
|
||||||
|
+ if (!dirfd)
|
||||||
|
+ return errno;
|
||||||
|
+
|
||||||
|
+ while ((dent = readdir(dirfd))) {
|
||||||
|
+ char lld_root[FILENAMESZ];
|
||||||
|
+
|
||||||
|
+ memset(&lld_root, 0 , FILENAMESZ);
|
||||||
|
+
|
||||||
|
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (strncmp(dent->d_name, ISCSI_LLD_SUBSYS_PREFIX, 10))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ snprintf(lld_root, FILENAMESZ, ISCSI_LLD_ROOT"%s",
|
||||||
|
+ dent->d_name);
|
||||||
|
+ if (!get_boot_info(context, lld_root, dent->d_name))
|
||||||
|
+ goto done;
|
||||||
|
+ }
|
||||||
|
+ rc = ENODEV;
|
||||||
|
+done:
|
||||||
|
+ closedir(dirfd);
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int get_targets(struct list_head *list, char *rootdir, char *subsys)
|
||||||
|
+{
|
||||||
|
+ struct boot_context *context;
|
||||||
|
+ int rc = 0, i, nic_idx, nic;
|
||||||
|
+ char initiator_dir[FILENAMESZ];
|
||||||
|
+
|
||||||
|
+ memset(&initiator_dir, 0 , FILENAMESZ);
|
||||||
|
+ snprintf(initiator_dir, FILENAMESZ, "%sinitiator", rootdir);
|
||||||
|
+
|
||||||
|
+ if (!file_exist(initiator_dir))
|
||||||
|
+ return ENODEV;
|
||||||
|
+
|
||||||
|
+ nic_cnt = 0;
|
||||||
|
+ tgt_cnt = 0;
|
||||||
|
+
|
||||||
|
+ /* Find the target's and the ethernet's */
|
||||||
|
+ nftw(rootdir, find_sysfs_dirs, 20, 1);
|
||||||
|
+ for (i = 0; i < tgt_cnt; i++) {
|
||||||
|
+ context = calloc(1, sizeof(*context));
|
||||||
|
+ if (!context) {
|
||||||
|
+ rc = ENOMEM;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ rc = fill_tgt_context(subsys, target_list[i], context);
|
||||||
|
+ if (rc)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ rc = sysfs_get_int(target_list[i], subsys, "nic-assoc",
|
||||||
|
+ &nic_idx);
|
||||||
|
+ if (rc)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ for (nic = 0; nic < nic_cnt; nic++) {
|
||||||
|
+ int id;
|
||||||
|
+
|
||||||
|
+ rc = sysfs_get_int(nic_list[nic], subsys, "index",
|
||||||
|
+ &id);
|
||||||
|
+ if (!rc && (id == nic_idx))
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (nic == nic_cnt) {
|
||||||
|
+ printf("Invalid nic-assoc of %d. Max id %d.\n",
|
||||||
|
+ nic_idx, nic_cnt);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ rc = fill_nic_context(subsys, nic_list[nic], context);
|
||||||
|
+ if (rc)
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
+ fill_initiator_context(subsys, context);
|
||||||
|
+ list_add_tail(&context->list, list);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (rc) {
|
||||||
|
+ if (context)
|
||||||
|
+ free(context);
|
||||||
|
+ fw_free_targets(list);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ deallocate_lists();
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int fwparam_sysfs_get_targets(struct list_head *list)
|
||||||
|
+{
|
||||||
|
+ struct dirent *dent;
|
||||||
|
+ DIR *dirfd;
|
||||||
|
+ int rc = 0;
|
||||||
|
+
|
||||||
|
+ /* ibft only has one instance */
|
||||||
|
+ get_targets(list, IBFT_SYSFS_ROOT, IBFT_SUBSYS);
|
||||||
|
+ /*
|
||||||
|
+ * We could have multiple iscsi llds and each lld could have
|
||||||
|
+ * multiple targets/ethernet ports
|
||||||
|
+ */
|
||||||
|
+ dirfd = opendir(ISCSI_LLD_ROOT);
|
||||||
|
+ if (!dirfd) {
|
||||||
|
+ rc = errno;
|
||||||
|
+ goto done;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ while ((dent = readdir(dirfd))) {
|
||||||
|
+ char lld_root[FILENAMESZ];
|
||||||
|
+
|
||||||
|
+ memset(&lld_root, 0 , FILENAMESZ);
|
||||||
|
+
|
||||||
|
+ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ if (strncmp(dent->d_name, ISCSI_LLD_SUBSYS_PREFIX, 10))
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ snprintf(lld_root, FILENAMESZ, ISCSI_LLD_ROOT"%s",
|
||||||
|
+ dent->d_name);
|
||||||
|
+ get_targets(list, lld_root, dent->d_name);
|
||||||
|
+ }
|
||||||
|
+ closedir(dirfd);
|
||||||
|
+done:
|
||||||
|
+ if (!rc && list_empty(list))
|
||||||
|
+ rc = ENODEV;
|
||||||
|
+ if (rc)
|
||||||
|
+ fw_free_targets(list);
|
||||||
|
+ return rc;
|
||||||
|
+}
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
@ -1,6 +1,20 @@
|
|||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/initiator.c
|
diff --git a/usr/Makefile b/usr/Makefile
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c 2010-01-15 02:24:02.000000000 -0600
|
index e9d6bd1..8e505bf 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/initiator.c 2010-01-15 03:46:45.000000000 -0600
|
--- 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 --git a/usr/initiator.c b/usr/initiator.c
|
||||||
|
index 1c9d8b6..8f7a383 100644
|
||||||
|
--- a/usr/initiator.c
|
||||||
|
+++ b/usr/initiator.c
|
||||||
@@ -45,6 +45,7 @@
|
@@ -45,6 +45,7 @@
|
||||||
#include "iscsi_sysfs.h"
|
#include "iscsi_sysfs.h"
|
||||||
#include "iscsi_settings.h"
|
#include "iscsi_settings.h"
|
||||||
@ -9,7 +23,7 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c open-iscsi-2.0-871.1.1-
|
|||||||
#include "sysdeps.h"
|
#include "sysdeps.h"
|
||||||
|
|
||||||
#define ISCSI_CONN_ERR_REOPEN_DELAY 3
|
#define ISCSI_CONN_ERR_REOPEN_DELAY 3
|
||||||
@@ -725,6 +726,38 @@ static int iscsi_conn_connect(struct isc
|
@@ -743,6 +744,38 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +62,7 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c open-iscsi-2.0-871.1.1-
|
|||||||
static void
|
static void
|
||||||
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
||||||
int redirected)
|
int redirected)
|
||||||
@@ -766,6 +799,11 @@ __session_conn_reopen(iscsi_conn_t *conn
|
@@ -784,6 +817,11 @@ __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
|
||||||
if (!redirected)
|
if (!redirected)
|
||||||
session->reopen_cnt++;
|
session->reopen_cnt++;
|
||||||
|
|
||||||
@ -60,7 +74,7 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c open-iscsi-2.0-871.1.1-
|
|||||||
if (iscsi_conn_connect(conn, qtask)) {
|
if (iscsi_conn_connect(conn, qtask)) {
|
||||||
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
|
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
|
||||||
goto queue_reopen;
|
goto queue_reopen;
|
||||||
@@ -2108,6 +2146,10 @@ static int iface_set_param(struct iscsi_
|
@@ -2130,6 +2168,10 @@ static int iface_set_param(struct iscsi_transport *t, struct iface_rec *iface,
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,30 +85,156 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/initiator.c open-iscsi-2.0-871.1.1-
|
|||||||
rc = __iscsi_host_set_param(t, session->hostno,
|
rc = __iscsi_host_set_param(t, session->hostno,
|
||||||
ISCSI_HOST_PARAM_IPADDRESS,
|
ISCSI_HOST_PARAM_IPADDRESS,
|
||||||
iface->ipaddress, ISCSI_STRING);
|
iface->ipaddress, ISCSI_STRING);
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/Makefile open-iscsi-2.0-871.1.1-bnx2i.work/usr/Makefile
|
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/Makefile 2010-01-15 02:24:02.000000000 -0600
|
index 5280a0a..6eb8b1d 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/Makefile 2010-01-15 04:07:30.000000000 -0600
|
--- a/usr/iscsid_req.c
|
||||||
@@ -41,7 +41,7 @@ ISCSI_LIB_SRCS = util.o io.o auth.o logi
|
+++ b/usr/iscsid_req.c
|
||||||
$(SYSDEPS_SRCS)
|
@@ -22,6 +22,7 @@
|
||||||
# core initiator files
|
#include <stdlib.h>
|
||||||
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o isns.o \
|
#include <string.h>
|
||||||
- transport.o cxgb3i.o be2iscsi.o
|
#include <errno.h>
|
||||||
+ transport.o cxgb3i.o be2iscsi.o uip_mgmt_ipc.o
|
+#include <fcntl.h>
|
||||||
# fw boot files
|
#include <sys/un.h>
|
||||||
FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
@@ -31,6 +32,7 @@
|
||||||
|
#include "mgmt_ipc.h"
|
||||||
|
#include "iscsi_util.h"
|
||||||
|
#include "config.h"
|
||||||
|
+#include "uip_mgmt_ipc.h"
|
||||||
|
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/transport.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/transport.c
|
static void iscsid_startup(void)
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/transport.c 2010-01-15 02:24:02.000000000 -0600
|
{
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/transport.c 2010-01-15 03:46:45.000000000 -0600
|
@@ -51,7 +53,8 @@ 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)
|
||||||
|
{
|
||||||
|
int nsec;
|
||||||
|
struct sockaddr_un addr;
|
||||||
|
@@ -64,8 +67,8 @@ static mgmt_ipc_err_e iscsid_connect(int *fd, int start_iscsid)
|
||||||
|
|
||||||
|
memset(&addr, 0, sizeof(addr));
|
||||||
|
addr.sun_family = AF_LOCAL;
|
||||||
|
- memcpy((char *) &addr.sun_path + 1, ISCSIADM_NAMESPACE,
|
||||||
|
- strlen(ISCSIADM_NAMESPACE));
|
||||||
|
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name,
|
||||||
|
+ strlen(unix_sock_name));
|
||||||
|
/*
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
+static mgmt_ipc_err_e iscsid_connect(int *fd, int 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 err;
|
||||||
|
@@ -190,6 +198,72 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
|
||||||
|
return iscsid_req_wait(cmd, fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
+static mgmt_ipc_err_e uip_connect(int *fd)
|
||||||
|
+{
|
||||||
|
+ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int uip_broadcast(void *buf, size_t buf_len)
|
||||||
|
+{
|
||||||
|
+ int err;
|
||||||
|
+ int fd;
|
||||||
|
+ iscsid_uip_rsp_t rsp;
|
||||||
|
+ int flags;
|
||||||
|
+ int count;
|
||||||
|
+
|
||||||
|
+ err = uip_connect(&fd);
|
||||||
|
+ if (err) {
|
||||||
|
+ log_warning("uIP daemon is not up");
|
||||||
|
+ return err;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* 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);
|
||||||
|
+ close(fd);
|
||||||
|
+ return -EIO;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* 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;
|
||||||
|
+ 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;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+#define MAX_UIP_BROADCAST_READ_TRIES 3
|
||||||
|
+ for(count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) {
|
||||||
|
+ /* 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);
|
||||||
|
+ break;
|
||||||
|
+ } else if((err == -1) && (errno == EAGAIN)) {
|
||||||
|
+ usleep(250000);
|
||||||
|
+ continue;
|
||||||
|
+ } else {
|
||||||
|
+ log_error("Could not read response (%d/%d), daemon died?",
|
||||||
|
+ err, errno);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if(count == MAX_UIP_BROADCAST_READ_TRIES)
|
||||||
|
+ log_error("Could not broadcast to uIP");
|
||||||
|
+
|
||||||
|
+ close(fd);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
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);
|
||||||
|
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
|
||||||
@@ -25,6 +25,7 @@
|
@@ -25,6 +25,7 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "util.h"
|
#include "iscsi_util.h"
|
||||||
#include "iscsi_sysfs.h"
|
#include "iscsi_sysfs.h"
|
||||||
+#include "uip_mgmt_ipc.h"
|
+#include "uip_mgmt_ipc.h"
|
||||||
#include "cxgb3i.h"
|
#include "cxgb3i.h"
|
||||||
#include "be2iscsi.h"
|
#include "be2iscsi.h"
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ struct iscsi_transport_template bnx2i =
|
@@ -58,6 +59,7 @@ struct iscsi_transport_template bnx2i = {
|
||||||
.ep_connect = ktransport_ep_connect,
|
.ep_connect = ktransport_ep_connect,
|
||||||
.ep_poll = ktransport_ep_poll,
|
.ep_poll = ktransport_ep_poll,
|
||||||
.ep_disconnect = ktransport_ep_disconnect,
|
.ep_disconnect = ktransport_ep_disconnect,
|
||||||
@ -102,9 +242,10 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/transport.c open-iscsi-2.0-871.1.1-
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct iscsi_transport_template be2iscsi = {
|
struct iscsi_transport_template be2iscsi = {
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/transport.h open-iscsi-2.0-871.1.1-bnx2i.work/usr/transport.h
|
diff --git a/usr/transport.h b/usr/transport.h
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/transport.h 2010-01-15 02:24:02.000000000 -0600
|
index 5ceedb3..2ec903c 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/transport.h 2010-01-15 03:46:45.000000000 -0600
|
--- a/usr/transport.h
|
||||||
|
+++ b/usr/transport.h
|
||||||
@@ -35,6 +35,9 @@ struct iscsi_transport_template {
|
@@ -35,6 +35,9 @@ struct iscsi_transport_template {
|
||||||
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
|
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
|
||||||
void (*ep_disconnect) (struct iscsi_conn *conn);
|
void (*ep_disconnect) (struct iscsi_conn *conn);
|
||||||
@ -115,9 +256,11 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/transport.h open-iscsi-2.0-871.1.1-
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* represents data path provider */
|
/* represents data path provider */
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/uip_mgmt_ipc.c
|
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.c 1969-12-31 18:00:00.000000000 -0600
|
new file mode 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/uip_mgmt_ipc.c 2010-01-15 03:46:45.000000000 -0600
|
index 0000000..73b1632
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/usr/uip_mgmt_ipc.c
|
||||||
@@ -0,0 +1,41 @@
|
@@ -0,0 +1,41 @@
|
||||||
+/*
|
+/*
|
||||||
+ * uIP iSCSI Daemon/Admin Management IPC
|
+ * uIP iSCSI Daemon/Admin Management IPC
|
||||||
@ -139,7 +282,7 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-871.1
|
|||||||
+
|
+
|
||||||
+#include "log.h"
|
+#include "log.h"
|
||||||
+#include "uip_mgmt_ipc.h"
|
+#include "uip_mgmt_ipc.h"
|
||||||
+#include "util.h"
|
+#include "iscsid_req.h"
|
||||||
+
|
+
|
||||||
+int uip_broadcast_params(struct iscsi_transport *t,
|
+int uip_broadcast_params(struct iscsi_transport *t,
|
||||||
+ struct iface_rec *iface,
|
+ struct iface_rec *iface,
|
||||||
@ -160,9 +303,11 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-871.1
|
|||||||
+ sizeof(iscsid_uip_broadcast_header_t) +
|
+ sizeof(iscsid_uip_broadcast_header_t) +
|
||||||
+ sizeof(*iface));
|
+ sizeof(*iface));
|
||||||
+}
|
+}
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-871.1.1-bnx2i.work/usr/uip_mgmt_ipc.h
|
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.h 1969-12-31 18:00:00.000000000 -0600
|
new file mode 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/uip_mgmt_ipc.h 2010-01-15 03:46:45.000000000 -0600
|
index 0000000..dd49c0b
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/usr/uip_mgmt_ipc.h
|
||||||
@@ -0,0 +1,71 @@
|
@@ -0,0 +1,71 @@
|
||||||
+/*
|
+/*
|
||||||
+ * uIP iSCSI Daemon/Admin Management IPC
|
+ * uIP iSCSI Daemon/Admin Management IPC
|
||||||
@ -235,143 +380,6 @@ diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-871.1
|
|||||||
+
|
+
|
||||||
+
|
+
|
||||||
+#endif /* UIP_MGMT_IPC_H */
|
+#endif /* UIP_MGMT_IPC_H */
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/util.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/util.c
|
--
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/util.c 2010-01-15 02:24:02.000000000 -0600
|
1.6.6.1
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/util.c 2010-01-15 04:05:49.000000000 -0600
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
#include "idbm.h"
|
|
||||||
#include "iface.h"
|
|
||||||
#include "session_info.h"
|
|
||||||
+#include "uip_mgmt_ipc.h"
|
|
||||||
|
|
||||||
void daemon_init(void)
|
|
||||||
{
|
|
||||||
@@ -201,7 +202,8 @@ 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)
|
|
||||||
{
|
|
||||||
int nsec;
|
|
||||||
struct sockaddr_un addr;
|
|
||||||
@@ -214,8 +216,8 @@ static mgmt_ipc_err_e iscsid_connect(int
|
|
||||||
|
|
||||||
memset(&addr, 0, sizeof(addr));
|
|
||||||
addr.sun_family = AF_LOCAL;
|
|
||||||
- memcpy((char *) &addr.sun_path + 1, ISCSIADM_NAMESPACE,
|
|
||||||
- strlen(ISCSIADM_NAMESPACE));
|
|
||||||
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name,
|
|
||||||
+ strlen(unix_sock_name));
|
|
||||||
/*
|
|
||||||
* Trying to connect with exponential backoff
|
|
||||||
*/
|
|
||||||
@@ -243,6 +245,11 @@ static mgmt_ipc_err_e iscsid_connect(int
|
|
||||||
return MGMT_IPC_ERR_ISCSID_NOTCONN;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static mgmt_ipc_err_e iscsid_connect(int *fd, int 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 err;
|
|
||||||
@@ -340,6 +347,72 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
|
|
||||||
return iscsid_req_wait(cmd, fd);
|
|
||||||
}
|
|
||||||
|
|
||||||
+static mgmt_ipc_err_e uip_connect(int *fd)
|
|
||||||
+{
|
|
||||||
+ return ipc_connect(fd, ISCSID_UIP_NAMESPACE, 0);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+int uip_broadcast(void *buf, size_t buf_len)
|
|
||||||
+{
|
|
||||||
+ int err;
|
|
||||||
+ int fd;
|
|
||||||
+ iscsid_uip_rsp_t rsp;
|
|
||||||
+ int flags;
|
|
||||||
+ int count;
|
|
||||||
+
|
|
||||||
+ err = uip_connect(&fd);
|
|
||||||
+ if (err) {
|
|
||||||
+ log_warning("uIP daemon is not up");
|
|
||||||
+ return err;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* 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);
|
|
||||||
+ close(fd);
|
|
||||||
+ return -EIO;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* 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;
|
|
||||||
+ 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;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+#define MAX_UIP_BROADCAST_READ_TRIES 3
|
|
||||||
+ for(count = 0; count < MAX_UIP_BROADCAST_READ_TRIES; count++) {
|
|
||||||
+ /* 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);
|
|
||||||
+ break;
|
|
||||||
+ } else if((err == -1) && (errno == EAGAIN)) {
|
|
||||||
+ usleep(250000);
|
|
||||||
+ continue;
|
|
||||||
+ } else {
|
|
||||||
+ log_error("Could not read response (%d/%d), daemon died?",
|
|
||||||
+ err, errno);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if(count == MAX_UIP_BROADCAST_READ_TRIES)
|
|
||||||
+ log_error("Could not broadcast to uIP");
|
|
||||||
+
|
|
||||||
+ close(fd);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
void idbm_node_setup_defaults(node_rec_t *rec)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/usr/util.h open-iscsi-2.0-871.1.1-bnx2i.work/usr/util.h
|
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/util.h 2010-01-15 02:24:02.000000000 -0600
|
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/util.h 2010-01-15 03:46:45.000000000 -0600
|
|
||||||
@@ -36,4 +36,7 @@ extern int __iscsi_match_session(struct
|
|
||||||
extern char *strstrip(char *s);
|
|
||||||
extern char *get_global_string_param(char *pathname, const char *key);
|
|
||||||
|
|
||||||
+extern int uip_broadcast(void *buf, size_t buf_len);
|
|
||||||
+
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
diff -Naurp open-iscsi-2.0-871.1.1-bnx2i/utils/iscsi-iname.c open-iscsi-2.0-871.1.1-bnx2i.work/utils/iscsi-iname.c
|
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/utils/iscsi-iname.c 2010-01-15 03:50:49.000000000 -0600
|
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/utils/iscsi-iname.c 2010-01-15 03:44:23.000000000 -0600
|
|
||||||
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
- prefix = "iqn.1994-05.com.redhat";
|
|
||||||
+ prefix = "iqn.1994-05.com.fedora";
|
|
||||||
}
|
|
||||||
|
|
||||||
/* try to feed some entropy from the pool to MD5 in order to get
|
|
||||||
|
@ -1,7 +1,54 @@
|
|||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/etc/iscsid.conf open-iscsi-2.0-871.1.1-bnx2i.work/etc/iscsid.conf
|
From 4f85b76a1c1bd54dd4d0779c4bf7da485a80b50e Mon Sep 17 00:00:00 2001
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/etc/iscsid.conf 2010-01-15 02:24:02.000000000 -0600
|
From: Mike Christie <michaelc@cs.wisc.edu>
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/etc/iscsid.conf 2010-01-15 03:42:00.000000000 -0600
|
Date: Tue, 23 Mar 2010 19:24:09 -0500
|
||||||
@@ -24,10 +24,10 @@
|
Subject: [PATCH 3/7] Add Red Hat specific info to docs.
|
||||||
|
|
||||||
|
iscsi-initiator-utils-update-initscripts-and-docs.patch
|
||||||
|
---
|
||||||
|
README | 9 +++------
|
||||||
|
etc/iscsid.conf | 23 ++++++++++-------------
|
||||||
|
usr/idbm.c | 4 ++++
|
||||||
|
3 files changed, 17 insertions(+), 19 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/README b/README
|
||||||
|
index eadb385..121bd45 100644
|
||||||
|
--- a/README
|
||||||
|
+++ b/README
|
||||||
|
@@ -74,11 +74,6 @@ the cache sync command will fail.
|
||||||
|
- iscsiadm's -P 3 option will not print out scsi devices.
|
||||||
|
- iscsid will not automatically online devices.
|
||||||
|
|
||||||
|
-You need to enable "Cryptographic API" under "Cryptographic options" in the
|
||||||
|
-kernel config. And you must enable "CRC32c CRC algorithm" even if
|
||||||
|
-you do not use header or data digests. They are the kernel options,
|
||||||
|
-CONFIG_CRYPTO and CONFIG_CRYPTO_CRC32C, respectively.
|
||||||
|
-
|
||||||
|
By default the kernel source found at
|
||||||
|
/lib/modules/`uname -a`/build
|
||||||
|
will be used to compile the open-iscsi modules. To specify a different
|
||||||
|
@@ -813,7 +808,7 @@ Red Hat or Fedora:
|
||||||
|
-----------------
|
||||||
|
To start open-iscsi in Red Hat/Fedora you can do:
|
||||||
|
|
||||||
|
- service open-iscsi start
|
||||||
|
+ service iscsi start
|
||||||
|
|
||||||
|
To get open-iscsi to automatically start at run time you may have to
|
||||||
|
run:
|
||||||
|
@@ -1012,6 +1007,8 @@ To login to all the automated nodes, simply restart the iscsi service:
|
||||||
|
e.g /etc/init.d/open-iscsi restart. On your next startup the nodes will
|
||||||
|
be logged into autmotically.
|
||||||
|
|
||||||
|
+To set the startup value, so that nodes are not logged into automatically
|
||||||
|
+use the value "manual".
|
||||||
|
|
||||||
|
8. Advanced Configuration
|
||||||
|
=========================
|
||||||
|
diff --git a/etc/iscsid.conf b/etc/iscsid.conf
|
||||||
|
index 78c225c..e96833e 100644
|
||||||
|
--- a/etc/iscsid.conf
|
||||||
|
+++ b/etc/iscsid.conf
|
||||||
|
@@ -17,10 +17,10 @@
|
||||||
# maintainers.
|
# maintainers.
|
||||||
#
|
#
|
||||||
# Default for Fedora and RHEL. (uncomment to activate).
|
# Default for Fedora and RHEL. (uncomment to activate).
|
||||||
@ -13,8 +60,8 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/etc/iscsid.conf open-iscsi-2.0-871.1.1-b
|
|||||||
+# iscsid.startup = /sbin/iscsid
|
+# iscsid.startup = /sbin/iscsid
|
||||||
|
|
||||||
|
|
||||||
#############################
|
|
||||||
@@ -43,8 +43,8 @@ iscsid.startup = /sbin/iscsid
|
@@ -110,8 +110,8 @@ iscsid.startup = /sbin/iscsid
|
||||||
# To request that the iscsi initd scripts startup a session set to "automatic".
|
# To request that the iscsi initd scripts startup a session set to "automatic".
|
||||||
# node.startup = automatic
|
# node.startup = automatic
|
||||||
#
|
#
|
||||||
@ -23,16 +70,15 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/etc/iscsid.conf open-iscsi-2.0-871.1.1-b
|
|||||||
+# To manually startup the session set to "manual". The default is automatic.
|
+# To manually startup the session set to "manual". The default is automatic.
|
||||||
+node.startup = automatic
|
+node.startup = automatic
|
||||||
|
|
||||||
|
|
||||||
# *************
|
# *************
|
||||||
# CHAP Settings
|
@@ -329,29 +329,26 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
|
||||||
@@ -252,29 +252,27 @@ node.conn[0].iscsi.MaxRecvDataSegmentLen
|
|
||||||
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
|
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
|
||||||
|
|
||||||
# To allow the targets to control the setting of the digest checking,
|
# To allow the targets to control the setting of the digest checking,
|
||||||
-# with the initiator requesting a preference of enabling the checking, uncomment# one or both of the following lines:
|
-# with the initiator requesting a preference of enabling the checking, uncomment# one or both of the following lines:
|
||||||
+# with the initiator requesting a preference of enabling the checking, uncomment
|
+# with the initiator requesting a preference of enabling the checking, uncomment
|
||||||
+# the following lines (Data digests are not supported and on ppc/ppc64
|
+# the following lines (Data digests are not supported.):
|
||||||
+# both header and data digests are not supported.):
|
|
||||||
#node.conn[0].iscsi.HeaderDigest = CRC32C,None
|
#node.conn[0].iscsi.HeaderDigest = CRC32C,None
|
||||||
-#node.conn[0].iscsi.DataDigest = CRC32C,None
|
-#node.conn[0].iscsi.DataDigest = CRC32C,None
|
||||||
#
|
#
|
||||||
@ -62,43 +108,11 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/etc/iscsid.conf open-iscsi-2.0-871.1.1-b
|
|||||||
|
|
||||||
#************
|
#************
|
||||||
# Workarounds
|
# Workarounds
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work/README
|
diff --git a/usr/idbm.c b/usr/idbm.c
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/README 2010-01-15 02:24:02.000000000 -0600
|
index 1428365..8ad8024 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/README 2010-01-15 03:40:46.000000000 -0600
|
--- a/usr/idbm.c
|
||||||
@@ -75,11 +75,6 @@ the cache sync command will fail.
|
+++ b/usr/idbm.c
|
||||||
- iscsiadm's -P 3 option will not print out scsi devices.
|
@@ -324,9 +324,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
|
||||||
- iscsid will not automatically online devices.
|
|
||||||
|
|
||||||
-You need to enable "Cryptographic API" under "Cryptographic options" in the
|
|
||||||
-kernel config. And you must enable "CRC32c CRC algorithm" even if
|
|
||||||
-you do not use header or data digests. They are the kernel options,
|
|
||||||
-CONFIG_CRYPTO and CONFIG_CRYPTO_CRC32C, respectively.
|
|
||||||
-
|
|
||||||
By default the kernel source found at
|
|
||||||
/lib/modules/`uname -a`/build
|
|
||||||
will be used to compile the open-iscsi modules. To specify a different
|
|
||||||
@@ -799,7 +794,7 @@ Red Hat or Fedora:
|
|
||||||
-----------------
|
|
||||||
To start open-iscsi in Red Hat/Fedora you can do:
|
|
||||||
|
|
||||||
- service open-iscsi start
|
|
||||||
+ service iscsi start
|
|
||||||
|
|
||||||
To get open-iscsi to automatically start at run time you may have to
|
|
||||||
run:
|
|
||||||
@@ -978,6 +973,8 @@ To login to all the automated nodes, sim
|
|
||||||
e.g /etc/init.d/open-iscsi restart. On your next startup the nodes will
|
|
||||||
be logged into autmotically.
|
|
||||||
|
|
||||||
+To set the startup value, so that nodes are not logged into automatically
|
|
||||||
+use the value "manual".
|
|
||||||
|
|
||||||
8. Advanced Configuration
|
|
||||||
=========================
|
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.c
|
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c 2010-01-15 02:24:02.000000000 -0600
|
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.c 2010-01-15 03:40:46.000000000 -0600
|
|
||||||
@@ -336,9 +336,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo
|
|
||||||
IDBM_SHOW, "None", "CRC32C", "CRC32C,None",
|
IDBM_SHOW, "None", "CRC32C", "CRC32C,None",
|
||||||
"None,CRC32C", num, 1);
|
"None,CRC32C", num, 1);
|
||||||
sprintf(key, CONN_DATA_DIGEST, i);
|
sprintf(key, CONN_DATA_DIGEST, i);
|
||||||
@ -112,3 +126,6 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c open-iscsi-2.0-871.1.1-bnx2i.
|
|||||||
sprintf(key, CONN_IFMARKER, i);
|
sprintf(key, CONN_IFMARKER, i);
|
||||||
__recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW,
|
__recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW,
|
||||||
"No", "Yes", num, 1);
|
"No", "Yes", num, 1);
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
||||||
|
@ -1,32 +1,8 @@
|
|||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/doc/iscsiadm.8 open-iscsi-2.0-871.1.1-bnx2i.work/doc/iscsiadm.8
|
diff --git a/README b/README
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/doc/iscsiadm.8 2010-01-15 02:24:02.000000000 -0600
|
index 121bd45..c863044 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/doc/iscsiadm.8 2010-01-15 03:43:24.000000000 -0600
|
--- a/README
|
||||||
@@ -49,7 +49,7 @@ display help text and exit
|
+++ b/README
|
||||||
.TP
|
@@ -144,10 +144,10 @@ available on all Linux installations.
|
||||||
\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
|
|
||||||
@@ -320,10 +320,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
|
|
||||||
-/etc/iscsi/nodes/
|
|
||||||
+/var/lib/iscsi/nodes/
|
|
||||||
This directory contains the nodes with their targets.
|
|
||||||
.TP
|
|
||||||
-/etc/iscsi/send_targets
|
|
||||||
+/var/lib/iscsi/send_targets
|
|
||||||
This directory contains the portals.
|
|
||||||
|
|
||||||
.SH "SEE ALSO"
|
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work/README
|
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/README 2010-01-15 03:43:42.000000000 -0600
|
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/README 2010-01-15 03:43:24.000000000 -0600
|
|
||||||
@@ -145,10 +145,10 @@ available on all Linux installations.
|
|
||||||
|
|
||||||
The database contains two tables:
|
The database contains two tables:
|
||||||
|
|
||||||
@ -40,7 +16,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
|
|
||||||
The iscsiadm utility is a command-line tool to manage (update, delete,
|
The iscsiadm utility is a command-line tool to manage (update, delete,
|
||||||
insert, query) the persistent database.
|
insert, query) the persistent database.
|
||||||
@@ -349,7 +349,7 @@ a scsi_host per HBA port).
|
@@ -352,7 +352,7 @@ a scsi_host per HBA port).
|
||||||
To manage both types of initiator stacks, iscsiadm uses the interface (iface)
|
To manage both types of initiator stacks, iscsiadm uses the interface (iface)
|
||||||
structure. For each HBA port or for software iscsi for each network
|
structure. For each HBA port or for software iscsi for each network
|
||||||
device (ethX) or NIC, that you wish to bind sessions to you must create
|
device (ethX) or NIC, that you wish to bind sessions to you must create
|
||||||
@ -49,7 +25,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
|
|
||||||
Running:
|
Running:
|
||||||
|
|
||||||
@@ -357,29 +357,29 @@ Running:
|
@@ -360,29 +360,29 @@ Running:
|
||||||
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
|
iface0 qla4xxx,00:c0:dd:08:63:e8,20.15.0.7,default,iqn.2005-06.com.redhat:madmax
|
||||||
iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
|
iface1 qla4xxx,00:c0:dd:08:63:ea,20.15.0.9,default,iqn.2005-06.com.redhat:madmax
|
||||||
|
|
||||||
@ -84,7 +60,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
|
|
||||||
iface.transport_name = tcp
|
iface.transport_name = tcp
|
||||||
iface.hwaddress = 00:C0:DD:08:63:E7
|
iface.hwaddress = 00:C0:DD:08:63:E7
|
||||||
@@ -428,7 +428,7 @@ iser iser,<empty>,<empty>,<empty>,<empty
|
@@ -431,7 +431,7 @@ iser iser,<empty>,<empty>,<empty>,<empty>
|
||||||
cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
|
cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
|
||||||
|
|
||||||
|
|
||||||
@ -93,7 +69,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
The format is:
|
The format is:
|
||||||
|
|
||||||
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
|
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
|
||||||
@@ -444,7 +444,7 @@ default one in /etc/iscsi/initiatorname.
|
@@ -447,7 +447,7 @@ default one in /etc/iscsi/initiatorname.iscsi.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -102,7 +78,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
|
|
||||||
iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07
|
iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07
|
||||||
# BEGIN RECORD 2.0-871
|
# BEGIN RECORD 2.0-871
|
||||||
@@ -482,7 +482,7 @@ need a seperate network connection to th
|
@@ -485,7 +485,7 @@ need a seperate network connection to the target for discovery purposes.
|
||||||
*This will be fixed in the next version of open-iscsi*
|
*This will be fixed in the next version of open-iscsi*
|
||||||
|
|
||||||
For compatibility reasons, when you run iscsiadm to do discovery, it
|
For compatibility reasons, when you run iscsiadm to do discovery, it
|
||||||
@ -111,7 +87,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
tcp for the iface.transport and it will bind the portals that are discovered
|
tcp for the iface.transport and it will bind the portals that are discovered
|
||||||
so that they will be logged in through those ifaces. This behavior can also
|
so that they will be logged in through those ifaces. This behavior can also
|
||||||
be overriden by passing in the interfaces you want to use. For the case
|
be overriden by passing in the interfaces you want to use. For the case
|
||||||
@@ -500,7 +500,7 @@ we do not bind a session to a iface, the
|
@@ -503,7 +503,7 @@ we do not bind a session to a iface, then you can use the special iface
|
||||||
|
|
||||||
iscsiadm -m discovery -t st -p ip:port -I default -P 1
|
iscsiadm -m discovery -t st -p ip:port -I default -P 1
|
||||||
|
|
||||||
@ -120,7 +96,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
not pass anything into iscsiadm, running iscsiadm will do the default
|
not pass anything into iscsiadm, running iscsiadm will do the default
|
||||||
behavior, where we allow the network subsystem to decide which
|
behavior, where we allow the network subsystem to decide which
|
||||||
device to use.
|
device to use.
|
||||||
@@ -540,7 +540,7 @@ To now log into targets it is the same a
|
@@ -543,7 +543,7 @@ To now log into targets it is the same as with sofware iscsi. See section
|
||||||
|
|
||||||
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260
|
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260
|
||||||
|
|
||||||
@ -129,8 +105,8 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
using software iscsi. If any are found then nodes found during
|
using software iscsi. If any are found then nodes found during
|
||||||
discovery will be setup so that they can logged in through
|
discovery will be setup so that they can logged in through
|
||||||
those interfaces.
|
those interfaces.
|
||||||
@@ -588,7 +588,7 @@ To now log into targets it is the same a
|
@@ -598,7 +598,7 @@ To now log into targets it is the same as with sofware iscsi. See section
|
||||||
existing portals.
|
This command will perform discovery, but not manipulate the node DB.
|
||||||
|
|
||||||
- SendTargets iSCSI Discovery with a specific interface. If you
|
- SendTargets iSCSI Discovery with a specific interface. If you
|
||||||
- wish to only use a subset of the interfaces in /etc/iscsi/ifaces
|
- wish to only use a subset of the interfaces in /etc/iscsi/ifaces
|
||||||
@ -138,7 +114,7 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
then you can pass them in during discovery:
|
then you can pass them in during discovery:
|
||||||
|
|
||||||
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 \
|
./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 \
|
||||||
@@ -873,8 +873,8 @@ where targetname is the name of the targ
|
@@ -911,8 +911,8 @@ where targetname is the name of the target and ip_address:port is the address
|
||||||
and port of the portal. tpgt, is the portal group tag of
|
and port of the portal. tpgt, is the portal group tag of
|
||||||
the portal, and is not used in iscsiadm commands except for static
|
the portal, and is not used in iscsiadm commands except for static
|
||||||
record creation. And iface name is the name of the iscsi interface
|
record creation. And iface name is the name of the iscsi interface
|
||||||
@ -149,10 +125,37 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/README open-iscsi-2.0-871.1.1-bnx2i.work
|
|||||||
Default here is iscsi_tcp/tcp to be used over which ever NIC the
|
Default here is iscsi_tcp/tcp to be used over which ever NIC the
|
||||||
network layer decides is best.
|
network layer decides is best.
|
||||||
|
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.c
|
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c 2010-01-15 03:43:42.000000000 -0600
|
index b2bad47..6f1bac9 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.c 2010-01-15 03:43:24.000000000 -0600
|
--- a/doc/iscsiadm.8
|
||||||
@@ -2139,9 +2139,9 @@ free_info:
|
+++ b/doc/iscsiadm.8
|
||||||
|
@@ -49,7 +49,7 @@ display help text and exit
|
||||||
|
.TP
|
||||||
|
\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
|
||||||
|
@@ -318,10 +318,10 @@ The configuration file read by \fBiscsid\fR and \fBiscsiadm\fR on startup.
|
||||||
|
The file containing the iSCSI InitiatorName and InitiatorAlias read by
|
||||||
|
\fBiscsid\fR and \fBiscsiadm\fR on startup.
|
||||||
|
.TP
|
||||||
|
-/etc/iscsi/nodes/
|
||||||
|
+/var/lib/iscsi/nodes/
|
||||||
|
This directory contains the nodes with their targets.
|
||||||
|
.TP
|
||||||
|
-/etc/iscsi/send_targets
|
||||||
|
+/var/lib/iscsi/send_targets
|
||||||
|
This directory contains the portals.
|
||||||
|
|
||||||
|
.SH "SEE ALSO"
|
||||||
|
diff --git a/usr/idbm.c b/usr/idbm.c
|
||||||
|
index 8ad8024..f5694f3 100644
|
||||||
|
--- a/usr/idbm.c
|
||||||
|
+++ b/usr/idbm.c
|
||||||
|
@@ -2078,9 +2078,9 @@ free_info:
|
||||||
int idbm_init(idbm_get_config_file_fn *fn)
|
int idbm_init(idbm_get_config_file_fn *fn)
|
||||||
{
|
{
|
||||||
/* make sure root db dir is there */
|
/* make sure root db dir is there */
|
||||||
@ -165,10 +168,11 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.c open-iscsi-2.0-871.1.1-bnx2i.
|
|||||||
errno);
|
errno);
|
||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.h open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.h
|
diff --git a/usr/idbm.h b/usr/idbm.h
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.h 2010-01-15 02:24:02.000000000 -0600
|
index 57b9295..44cb976 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/idbm.h 2010-01-15 03:43:24.000000000 -0600
|
--- a/usr/idbm.h
|
||||||
@@ -26,12 +26,15 @@
|
+++ b/usr/idbm.h
|
||||||
|
@@ -27,12 +27,15 @@
|
||||||
#include "initiator.h"
|
#include "initiator.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
@ -190,9 +194,10 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/idbm.h open-iscsi-2.0-871.1.1-bnx2i.
|
|||||||
#define ST_CONFIG_NAME "st_config"
|
#define ST_CONFIG_NAME "st_config"
|
||||||
|
|
||||||
#define TYPE_INT 0
|
#define TYPE_INT 0
|
||||||
diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/iface.h open-iscsi-2.0-871.1.1-bnx2i.work/usr/iface.h
|
diff --git a/usr/iface.h b/usr/iface.h
|
||||||
--- open-iscsi-2.0-871.1.1-bnx2i/usr/iface.h 2010-01-15 02:24:02.000000000 -0600
|
index 9f6d47e..f7624ea 100644
|
||||||
+++ open-iscsi-2.0-871.1.1-bnx2i.work/usr/iface.h 2010-01-15 03:43:24.000000000 -0600
|
--- a/usr/iface.h
|
||||||
|
+++ b/usr/iface.h
|
||||||
@@ -20,7 +20,9 @@
|
@@ -20,7 +20,9 @@
|
||||||
#ifndef ISCSI_IFACE_H
|
#ifndef ISCSI_IFACE_H
|
||||||
#define ISCSI_IFACE_H
|
#define ISCSI_IFACE_H
|
||||||
@ -204,3 +209,6 @@ diff -aurp open-iscsi-2.0-871.1.1-bnx2i/usr/iface.h open-iscsi-2.0-871.1.1-bnx2i
|
|||||||
|
|
||||||
struct iface_rec;
|
struct iface_rec;
|
||||||
struct list_head;
|
struct list_head;
|
||||||
|
--
|
||||||
|
1.6.6.1
|
||||||
|
|
||||||
|
@ -2,26 +2,26 @@
|
|||||||
|
|
||||||
Summary: iSCSI daemon and utility programs
|
Summary: iSCSI daemon and utility programs
|
||||||
Name: iscsi-initiator-utils
|
Name: iscsi-initiator-utils
|
||||||
Version: 6.2.0.871.1.1
|
Version: 6.2.0.872
|
||||||
Release: 3%{?dist}
|
Release: 0%{?dist}
|
||||||
Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-871.1.1-bnx2i.tar.gz
|
Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc1-bnx2i.tar.gz
|
||||||
Source1: iscsid.init
|
Source1: iscsid.init
|
||||||
Source2: iscsidevs.init
|
Source2: iscsidevs.init
|
||||||
Source3: 04-iscsi
|
Source3: 04-iscsi
|
||||||
|
# fw boot support
|
||||||
|
Patch0: iscsi-initiator-utils-fw-boot.patch
|
||||||
# Add Red Hat specific info to docs.
|
# Add Red Hat specific info to docs.
|
||||||
Patch0: iscsi-initiator-utils-update-initscripts-and-docs.patch
|
Patch1: iscsi-initiator-utils-update-initscripts-and-docs.patch
|
||||||
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
|
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
|
||||||
Patch1: iscsi-initiator-utils-use-var-for-config.patch
|
Patch2: iscsi-initiator-utils-use-var-for-config.patch
|
||||||
# Add redhat.com string to default initiator name.
|
# Add redhat.com string to default initiator name.
|
||||||
Patch2: iscsi-initiator-utils-use-red-hat-for-name.patch
|
Patch3: iscsi-initiator-utils-use-red-hat-for-name.patch
|
||||||
# Add a lib for use by anaconda.
|
# Add a lib for use by anaconda.
|
||||||
Patch3: iscsi-initiator-utils-add-libiscsi.patch
|
Patch4: iscsi-initiator-utils-add-libiscsi.patch
|
||||||
# Add bnx2i support.
|
# Add bnx2i support.
|
||||||
Patch4: iscsi-initiator-utils-uip-mgmt.patch
|
Patch5: iscsi-initiator-utils-uip-mgmt.patch
|
||||||
# Fixed some compile errors found in F12
|
# disable isns for libiscsi (libiscsi does not support isns)
|
||||||
Patch5: iscsi-initiator-utils-fix-missing-includes.patch
|
Patch6: iscsi-initiator-utils-disable-isns-for-lib.patch
|
||||||
# Fixed some compile errors on s390.
|
|
||||||
Patch6: iscsi-initiator-utils-fix-s390-compile.patch
|
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -47,16 +47,20 @@ The %{name}-devel package contains libraries and header files for
|
|||||||
developing applications that use %{name}.
|
developing applications that use %{name}.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n open-iscsi-2.0-871.1.1-bnx2i
|
%setup -q -n open-iscsi-2.0-872-rc1-bnx2i
|
||||||
%patch0 -p1 -b .update-initscripts-and-docs
|
%patch0 -p1 -b .fw-boot
|
||||||
%patch1 -p1 -b .use-var-for-config
|
%patch1 -p1 -b .update-initscripts-and-docs
|
||||||
%patch2 -p1 -b .use-red-hat-for-name
|
%patch2 -p1 -b .use-var-for-config
|
||||||
%patch3 -p1 -b .add-libiscsi
|
%patch3 -p1 -b .use-red-hat-for-name
|
||||||
%patch4 -p1 -b .uip-mgmt
|
%patch4 -p1 -b .add-libiscsi
|
||||||
%patch5 -p1 -b .fix-missing-includes
|
%patch5 -p1 -b .uip-mgmt
|
||||||
%patch6 -p1 -b .fix-s390-compile
|
%patch6 -p1 -b .disable-isns-for-lib
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
cd utils/open-isns
|
||||||
|
./configure
|
||||||
|
make OPTFLAGS="%{optflags}"
|
||||||
|
cd ../../
|
||||||
make OPTFLAGS="%{optflags}" -C utils/sysdeps
|
make OPTFLAGS="%{optflags}" -C utils/sysdeps
|
||||||
make OPTFLAGS="%{optflags}" -C utils/fwparam_ibft
|
make OPTFLAGS="%{optflags}" -C utils/fwparam_ibft
|
||||||
make OPTFLAGS="%{optflags}" -C usr
|
make OPTFLAGS="%{optflags}" -C usr
|
||||||
@ -169,6 +173,10 @@ fi
|
|||||||
%{_includedir}/libiscsi.h
|
%{_includedir}/libiscsi.h
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 24 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.0
|
||||||
|
- 516444 Add iSNS SCN handling (rebased to open-iscsi-2.0-872-rc1-)
|
||||||
|
- Update brcm to 0.5.7
|
||||||
|
|
||||||
* Mon Feb 8 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-3
|
* Mon Feb 8 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-3
|
||||||
- Add spec patch comments.
|
- Add spec patch comments.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user