[iscsi-initiator-utils: 47/109] Resolves: #602899

Chris Leech cleech at fedoraproject.org
Tue Dec 10 21:23:19 UTC 2013


commit f8d692d13df13d7c525fca1cbc80153c6c0126d5
Author: mchristi <mchristi at redhat.com>
Date:   Sun Jul 11 09:27:41 2010 +0000

    Resolves: #602899

 .cvsignore                                         |    4 +
 iscsi-initiator-utils-add-libiscsi.patch           |  258 --------------------
 iscsi-initiator-utils-log-info.patch               |  104 --------
 ...itiator-utils-update-initscripts-and-docs.patch |  105 ++++-----
 iscsi-initiator-utils-use-var-for-config.patch     |  152 +++++++-----
 iscsi-initiator-utils.spec                         |   63 ++---
 iscsid.init                                        |   12 +-
 sources                                            |    2 +-
 8 files changed, 171 insertions(+), 529 deletions(-)
---
diff --git a/.cvsignore b/.cvsignore
index 059e6a6..1e58e08 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -2,3 +2,7 @@ open-iscsi-2.0-870.1.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
+open-iscsi-2.0-872-rc2-bnx2i.tar.gz
+open-iscsi-2.0-872-rc3.tar.gz
+open-iscsi-2.0-872-rc3-bnx2i.tar.gz
+open-iscsi-2.0-872-rc4-bnx2i.tar.gz
diff --git a/iscsi-initiator-utils-add-libiscsi.patch b/iscsi-initiator-utils-add-libiscsi.patch
index ee9332a..4cc7db8 100644
--- a/iscsi-initiator-utils-add-libiscsi.patch
+++ b/iscsi-initiator-utils-add-libiscsi.patch
@@ -3735,261 +3735,3 @@ index 74ef948..713914f 100644
 +struct iscsi_ipc *ipc;
 +
  #endif /* ISCSI_IPC_H */
-diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
-index df55105..1561341 100644
---- a/usr/iscsiadm.c
-+++ b/usr/iscsiadm.c
-@@ -1495,8 +1495,7 @@ main(int argc, char **argv)
- 	umask(0177);
- 
- 	/* enable stdout logging */
--	log_daemon = 0;
--	log_init(program_name, 1024);
-+	log_init(program_name, 1024, log_do_log_stderr, NULL);
- 	sysfs_init();
- 
- 	optopt = 0;
-diff --git a/usr/iscsid.c b/usr/iscsid.c
-index fcb5eb3..8238e2b 100644
---- a/usr/iscsid.c
-+++ b/usr/iscsid.c
-@@ -57,6 +57,7 @@ static char program_name[] = "iscsid";
- int control_fd, mgmt_ipc_fd;
- static pid_t log_pid;
- static gid_t gid;
-+static int daemonize = 1;
- 
- static struct option const long_options[] = {
- 	{"config", required_argument, NULL, 'c'},
-@@ -293,7 +294,7 @@ static void iscsid_shutdown(void)
- 		log_debug(7, "cleaned up pid %d", pid);
- 
- 	log_warning("iscsid shutting down.");
--	if (log_daemon && log_pid >= 0) {
-+	if (daemonize && log_pid >= 0) {
- 		log_debug(1, "daemon stopping");
- 		log_close(log_pid);
- 	}
-@@ -356,7 +357,7 @@ int main(int argc, char *argv[])
- 			initiatorname_file = optarg;
- 			break;
- 		case 'f':
--			log_daemon = 0;
-+			daemonize = 0;
- 			break;
- 		case 'd':
- 			log_level = atoi(optarg);
-@@ -384,7 +385,8 @@ int main(int argc, char *argv[])
- 	}
- 
- 	/* initialize logger */
--	log_pid = log_init(program_name, DEFAULT_AREA_SIZE);
-+	log_pid = log_init(program_name, DEFAULT_AREA_SIZE,
-+		      daemonize ? log_do_log_daemon : log_do_log_stderr, NULL);
- 	if (log_pid < 0)
- 		exit(1);
- 
-@@ -411,7 +413,7 @@ int main(int argc, char *argv[])
- 		exit(1);
- 	}
- 
--	if (log_daemon) {
-+	if (daemonize) {
- 		char buf[64];
- 		int fd;
- 
-diff --git a/usr/iscsistart.c b/usr/iscsistart.c
-index 94a9601..6e4c3dc 100644
---- a/usr/iscsistart.c
-+++ b/usr/iscsistart.c
-@@ -256,8 +256,7 @@ int main(int argc, char *argv[])
- 	sigaction(SIGINT, &sa_new, &sa_old );
- 
- 	/* initialize logger */
--	log_daemon = 0;
--	log_init(program_name, DEFAULT_AREA_SIZE);
-+	log_init(program_name, DEFAULT_AREA_SIZE, log_do_log_stderr, NULL);
- 
- 	sysfs_init();
- 	if (iscsi_sysfs_check_class_version())
-diff --git a/usr/log.c b/usr/log.c
-index 7dd6de8..6f276c4 100644
---- a/usr/log.c
-+++ b/usr/log.c
-@@ -32,10 +32,11 @@
- #endif
- 
- char *log_name;
--int log_daemon = 1;
- int log_level = 0;
- 
- static int log_stop_daemon = 0;
-+static void (*log_func)(int prio, void *priv, const char *fmt, va_list ap);
-+static void *log_func_priv;
- 
- static void free_logarea (void)
- {
-@@ -258,40 +259,39 @@ static void log_syslog (void * buff)
- 	syslog(msg->prio, "%s", (char *)&msg->str);
- }
- 
--static void dolog(int prio, const char *fmt, va_list ap)
-+void log_do_log_daemon(int prio, void *priv, const char *fmt, va_list ap)
- {
--	if (log_daemon) {
--		struct sembuf ops[1];
-+	struct sembuf ops[1];
- 
--		ops[0].sem_num = la->ops[0].sem_num;
--		ops[0].sem_flg = la->ops[0].sem_flg;
-+	ops[0].sem_num = la->ops[0].sem_num;
-+	ops[0].sem_flg = la->ops[0].sem_flg;
- 
--		ops[0].sem_op = -1;
--		if (semop(la->semid, ops, 1) < 0) {
--			syslog(LOG_ERR, "semop down failed %d", errno);
--			return;
--		}
-+	ops[0].sem_op = -1;
-+	if (semop(la->semid, ops, 1) < 0) {
-+		syslog(LOG_ERR, "semop down failed %d", errno);
-+		return;
-+	}
- 
--		log_enqueue(prio, fmt, ap);
-+	log_enqueue(prio, fmt, ap);
- 
--		ops[0].sem_op = 1;
--		if (semop(la->semid, ops, 1) < 0) {
--			syslog(LOG_ERR, "semop up failed");
--			return;
--		}
--	} else {
--		fprintf(stderr, "%s: ", log_name);
--		vfprintf(stderr, fmt, ap);
--		fprintf(stderr, "\n");
--		fflush(stderr);
--	}
-+	ops[0].sem_op = 1;
-+	if (semop(la->semid, ops, 1) < 0)
-+		syslog(LOG_ERR, "semop up failed");
-+}
-+
-+void log_do_log_stderr(int prio, void *priv, const char *fmt, va_list ap)
-+{
-+	fprintf(stderr, "%s: ", log_name);
-+	vfprintf(stderr, fmt, ap);
-+	fprintf(stderr, "\n");
-+	fflush(stderr);
- }
- 
- void log_warning(const char *fmt, ...)
- {
- 	va_list ap;
- 	va_start(ap, fmt);
--	dolog(LOG_WARNING, fmt, ap);
-+	log_func(LOG_WARNING, log_func_priv, fmt, ap);
- 	va_end(ap);
- }
- 
-@@ -299,7 +299,7 @@ void log_error(const char *fmt, ...)
- {
- 	va_list ap;
- 	va_start(ap, fmt);
--	dolog(LOG_ERR, fmt, ap);
-+	log_func(LOG_ERR, log_func_priv, fmt, ap);
- 	va_end(ap);
- }
- 
-@@ -308,7 +308,7 @@ void log_debug(int level, const char *fmt, ...)
- 	if (log_level > level) {
- 		va_list ap;
- 		va_start(ap, fmt);
--		dolog(LOG_DEBUG, fmt, ap);
-+		log_func(LOG_DEBUG, log_func_priv, fmt, ap);
- 		va_end(ap);
- 	}
- }
-@@ -389,19 +389,23 @@ static void catch_signal(int signo)
- 
- static void __log_close(void)
- {
--	if (log_daemon) {
-+	if (log_func == log_do_log_daemon) {
- 		log_flush();
- 		closelog();
- 		free_logarea();
- 	}
- }
- 
--int log_init(char *program_name, int size)
-+int log_init(char *program_name, int size,
-+	void (*func)(int prio, void *priv, const char *fmt, va_list ap),
-+	void *priv)
- {
- 	logdbg(stderr,"enter log_init\n");
- 	log_name = program_name;
-+	log_func = func;
-+	log_func_priv = priv;
- 
--	if (log_daemon) {
-+	if (log_func == log_do_log_daemon) {
- 		struct sigaction sa_old;
- 		struct sigaction sa_new;
- 		pid_t pid;
-@@ -447,11 +451,12 @@ int log_init(char *program_name, int size)
- 
- 	return 0;
- }
-+
- void log_close(pid_t pid)
- {
- 	int status;
- 
--	if (!log_daemon || pid < 0) {
-+	if (log_func != log_do_log_daemon || pid < 0) {
- 		__log_close();
- 		return;
- 	}
-diff --git a/usr/log.h b/usr/log.h
-index 8af7986..c3b3955 100644
---- a/usr/log.h
-+++ b/usr/log.h
-@@ -26,6 +26,7 @@
- #ifndef LOG_H
- #define LOG_H
- 
-+#include <stdarg.h>
- #include <sys/types.h>
- #include "iscsid.h"
- 
-@@ -40,7 +41,6 @@ union semun {
- #define DEFAULT_AREA_SIZE 16384
- #define MAX_MSG_SIZE 256
- 
--extern int log_daemon;
- extern int log_level;
- 
- struct logmsg {
-@@ -66,7 +66,9 @@ struct logarea {
- 
- struct logarea *la;
- 
--extern int log_init (char * progname, int size);
-+extern int log_init(char *program_name, int size,
-+	void (*func)(int prio, void *priv, const char *fmt, va_list ap),
-+	void *priv);
- extern void log_close (pid_t pid);
- extern void dump_logmsg (void *);
- extern void log_warning(const char *fmt, ...)
-@@ -76,4 +78,7 @@ extern void log_error(const char *fmt, ...)
- extern void log_debug(int level, const char *fmt, ...)
- 	__attribute__ ((format (printf, 2, 3)));
- 
-+extern void log_do_log_daemon(int prio, void *priv, const char *fmt, va_list ap);
-+extern void log_do_log_stderr(int prio, void *priv, const char *fmt, va_list ap);
-+
- #endif	/* LOG_H */
--- 
-1.6.6.1
-
diff --git a/iscsi-initiator-utils-log-info.patch b/iscsi-initiator-utils-log-info.patch
index 938f493..2201ad3 100644
--- a/iscsi-initiator-utils-log-info.patch
+++ b/iscsi-initiator-utils-log-info.patch
@@ -21,107 +21,3 @@ diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/log.c open-iscsi-2.0-872-rc1-bnx2i.w
  }
  
  void log_warning(const char *fmt, ...)
-@@ -313,6 +318,14 @@ void log_debug(int level, const char *fm
- 	}
- }
- 
-+void log_info(const char *fmt, ...)
-+{
-+	va_list ap;
-+	va_start(ap, fmt);
-+	log_func(LOG_INFO, log_func_priv, fmt, ap);
-+	va_end(ap);
-+}
-+
- static void __dump_line(int level, unsigned char *buf, int *cp)
- {
- 	char line[16*3+5], *lp = line;
-diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/log.h open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.h
---- open-iscsi-2.0-872-rc1-bnx2i/usr/log.h	2010-05-06 15:26:01.000000000 -0500
-+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/log.h	2010-05-06 15:39:58.000000000 -0500
-@@ -71,6 +71,8 @@ extern int log_init(char *program_name, 
- 	void *priv);
- extern void log_close (pid_t pid);
- extern void dump_logmsg (void *);
-+extern void log_info(const char *fmt, ...)
-+	__attribute__ ((format (printf, 1, 2)));
- extern void log_warning(const char *fmt, ...)
- 	__attribute__ ((format (printf, 1, 2)));
- extern void log_error(const char *fmt, ...)
-diff -aurp open-iscsi-2.0-872-rc1-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc1-bnx2i.work/usr/session_mgmt.c
---- open-iscsi-2.0-872-rc1-bnx2i/usr/session_mgmt.c	2010-05-06 15:26:01.000000000 -0500
-+++ open-iscsi-2.0-872-rc1-bnx2i.work/usr/session_mgmt.c	2010-05-06 15:43:28.000000000 -0500
-@@ -42,10 +42,10 @@ static void log_login_msg(struct node_re
- 			  rec->conn[0].port);
- 		iscsid_handle_error(rc);
- 	} else
--		log_warning("Login to [iface: %s, target: %s, portal: "
--			    "%s,%d] successful.", rec->iface.name,
--			    rec->name, rec->conn[0].address,
--			    rec->conn[0].port);
-+		log_info("Login to [iface: %s, target: %s, portal: "
-+			 "%s,%d] successful.", rec->iface.name,
-+			 rec->name, rec->conn[0].address,
-+			 rec->conn[0].port);
- }
- 
- struct iscsid_async_req {
-@@ -100,15 +100,15 @@ int iscsi_login_portal(void *data, struc
- 	struct iscsid_async_req *async_req = NULL;
- 	int rc = 0, fd;
- 
--	log_warning("Logging in to [iface: %s, target: %s, portal: %s,%d]",
--		    rec->iface.name, rec->name, rec->conn[0].address,
--		    rec->conn[0].port);
-+	log_info("Logging in to [iface: %s, target: %s, portal: %s,%d]",
-+		 rec->iface.name, rec->name, rec->conn[0].address,
-+		 rec->conn[0].port);
- 
- 	if (list) {
- 		async_req = calloc(1, sizeof(*async_req));
- 		if (!async_req)
--			log_error("Could not allocate memory for async login "
--				  "handling. Using sequential login instead.");
-+			log_info("Could not allocate memory for async login "
-+				 "handling. Using sequential login instead.");
- 		else
- 			INIT_LIST_HEAD(&async_req->list);
- 	}
-@@ -215,10 +215,10 @@ static void log_logout_msg(struct sessio
- 			  info->persistent_address, info->port);
- 		iscsid_handle_error(rc);
- 	} else
--		log_warning("Logout of [sid: %d, target: %s, "
--			    "portal: %s,%d] successful.",
--			    info->sid, info->targetname,
--			    info->persistent_address, info->port);
-+		log_info("Logout of [sid: %d, target: %s, "
-+			 "portal: %s,%d] successful.",
-+			 info->sid, info->targetname,
-+			 info->persistent_address, info->port);
- }
- 
- static int iscsid_logout_reqs_wait(struct list_head *list)
-@@ -252,16 +252,16 @@ int iscsi_logout_portal(struct session_i
- 	int fd, rc;
- 
- 	/* TODO: add fn to add session prefix info like dev_printk */
--	log_warning("Logging out of session [sid: %d, target: %s, portal: "
--		    "%s,%d]",
--		    info->sid, info->targetname, info->persistent_address,
--		    info->port);
-+	log_info("Logging out of session [sid: %d, target: %s, portal: "
-+		 "%s,%d]",
-+		 info->sid, info->targetname, info->persistent_address,
-+		 info->port);
- 
- 	if (list) {
- 		async_req = calloc(1, sizeof(*async_req));
- 		if (!async_req)
--			log_error("Could not allocate memory for async logout "
--				  "handling. Using sequential logout instead.");
-+			log_info("Could not allocate memory for async logout "
-+				 "handling. Using sequential logout instead.");
- 	}
- 
- 	if (!async_req)
diff --git a/iscsi-initiator-utils-update-initscripts-and-docs.patch b/iscsi-initiator-utils-update-initscripts-and-docs.patch
index 7ae1e5f..eb8003f 100644
--- a/iscsi-initiator-utils-update-initscripts-and-docs.patch
+++ b/iscsi-initiator-utils-update-initscripts-and-docs.patch
@@ -1,53 +1,6 @@
-From 4f85b76a1c1bd54dd4d0779c4bf7da485a80b50e Mon Sep 17 00:00:00 2001
-From: Mike Christie <michaelc at cs.wisc.edu>
-Date: Tue, 23 Mar 2010 19:24:09 -0500
-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
+diff -aurp open-iscsi-2.0-872-rc3-bnx2i/etc/iscsid.conf open-iscsi-2.0-872-rc3-bnx2i.diff/etc/iscsid.conf
+--- open-iscsi-2.0-872-rc3-bnx2i/etc/iscsid.conf	2010-07-11 03:45:50.000000000 -0500
++++ open-iscsi-2.0-872-rc3-bnx2i.diff/etc/iscsid.conf	2010-07-11 03:57:57.000000000 -0500
 @@ -17,10 +17,10 @@
  # maintainers.
  #
@@ -60,8 +13,8 @@ index 78c225c..e96833e 100644
 +# iscsid.startup = /sbin/iscsid
  
  
- 
-@@ -110,8 +110,8 @@ iscsid.startup = /sbin/iscsid
+ #############################
+@@ -36,8 +36,8 @@ iscsid.startup = /sbin/iscsid
  # To request that the iscsi initd scripts startup a session set to "automatic".
  # node.startup = automatic
  #
@@ -72,7 +25,7 @@ index 78c225c..e96833e 100644
  
  
  # *************
-@@ -329,29 +329,26 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
+@@ -255,29 +255,26 @@ node.conn[0].iscsi.MaxXmitDataSegmentLen
  discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
  
  # To allow the targets to control the setting of the digest checking,
@@ -108,11 +61,44 @@ index 78c225c..e96833e 100644
  
  #************
  # Workarounds
-diff --git a/usr/idbm.c b/usr/idbm.c
-index 1428365..8ad8024 100644
---- a/usr/idbm.c
-+++ b/usr/idbm.c
-@@ -324,9 +324,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
+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:45:50.000000000 -0500
++++ open-iscsi-2.0-872-rc3-bnx2i.diff/README	2010-07-11 03:57:57.000000000 -0500
+@@ -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
+@@ -907,7 +902,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:
+@@ -1115,6 +1110,8 @@ iscsid will only perform rediscovery whe
+ #   linux-isns (SLES's iSNS server) where it sometimes does not send SCN
+ #   events in the proper format, so they may not get handled.
+ 
++To set the startup value, so that nodes are not logged into automatically
++use the value "manual".
+ 
+ Example:
+ --------
+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:45:50.000000000 -0500
++++ open-iscsi-2.0-872-rc3-bnx2i.diff/usr/idbm.c	2010-07-11 03:57:57.000000000 -0500
+@@ -346,9 +346,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo
  				 IDBM_SHOW, "None", "CRC32C", "CRC32C,None",
  				 "None,CRC32C", num, 1);
  		sprintf(key, CONN_DATA_DIGEST, i);
@@ -126,6 +112,3 @@ index 1428365..8ad8024 100644
  		sprintf(key, CONN_IFMARKER, i);
  		__recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW,
  				"No", "Yes", num, 1);
--- 
-1.6.6.1
-
diff --git a/iscsi-initiator-utils-use-var-for-config.patch b/iscsi-initiator-utils-use-var-for-config.patch
index adf7635..6ed53e5 100644
--- a/iscsi-initiator-utils-use-var-for-config.patch
+++ b/iscsi-initiator-utils-use-var-for-config.patch
@@ -1,7 +1,41 @@
-diff --git a/README b/README
-index 121bd45..c863044 100644
---- a/README
-+++ b/README
+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
+ .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
+@@ -128,7 +128,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
+-for \fIiface\fR, all ifaces setup in /etc/iscsi/ifaces are displayed.
++for \fIiface\fR, all ifaces setup in /var/lib/iscsi/ifaces are displayed.
+ 
+ .TP
+ \fB\-n\fR, \fB\-\-name=\fIname\fR
+@@ -336,10 +336,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"
+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
 @@ -144,10 +144,10 @@ available on all Linux installations.
  
  The database contains two tables:
@@ -16,7 +50,7 @@ index 121bd45..c863044 100644
  
  The iscsiadm utility is a command-line tool to manage (update, delete,
  insert, query) the persistent database.
-@@ -352,7 +352,7 @@ a scsi_host per HBA port).
+@@ -420,7 +420,7 @@ a scsi_host per HBA port).
  To manage both types of initiator stacks, iscsiadm uses the interface (iface)
  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
@@ -25,7 +59,7 @@ index 121bd45..c863044 100644
  
  Running:
  
-@@ -360,29 +360,29 @@ Running:
+@@ -428,29 +428,29 @@ Running:
  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
  
@@ -60,7 +94,7 @@ index 121bd45..c863044 100644
  
  iface.transport_name = tcp
  iface.hwaddress = 00:C0:DD:08:63:E7
-@@ -431,7 +431,7 @@ iser iser,<empty>,<empty>,<empty>,<empty>
+@@ -499,7 +499,7 @@ iser iser,<empty>,<empty>,<empty>,<empty
  cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
  
  
@@ -69,7 +103,7 @@ index 121bd45..c863044 100644
  The format is:
  
  iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
-@@ -447,7 +447,7 @@ default one in /etc/iscsi/initiatorname.iscsi.
+@@ -515,7 +515,7 @@ default one in /etc/iscsi/initiatorname.
  
  
  
@@ -78,7 +112,7 @@ index 121bd45..c863044 100644
  
  iscsiadm -m iface -I cxgb3i.00:07:43:05:97:07
  # BEGIN RECORD 2.0-871
-@@ -485,7 +485,7 @@ need a seperate network connection to the target for discovery purposes.
+@@ -553,7 +553,7 @@ need a seperate network connection to th
  *This will be fixed in the next version of open-iscsi*
  
  For compatibility reasons, when you run iscsiadm to do discovery, it
@@ -87,25 +121,32 @@ index 121bd45..c863044 100644
  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
  be overriden by passing in the interfaces you want to use. For the case
-@@ -503,7 +503,7 @@ we do not bind a session to a iface, then you can use the special iface
+@@ -571,7 +571,7 @@ we do not bind a session to a iface, the
  
- iscsiadm -m discovery -t st -p ip:port -I default -P 1
+ iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
  
 -And if you did not define any interfaces in /etc/iscsi/ifaces and do
 +And if you did not define any interfaces in /var/lib/iscsi/ifaces and do
  not pass anything into iscsiadm, running iscsiadm will do the default
  behavior, where we allow the network subsystem to decide which
  device to use.
-@@ -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
- 
--	This will first search /etc/iscsi/ifaces for interfaces
-+	This will first search /var/lib/iscsi/ifaces for interfaces
- 	using software iscsi. If any are found then nodes found during
- 	discovery will be setup so that they can logged in through
- 	those interfaces.
-@@ -598,7 +598,7 @@ To now log into targets it is the same as with sofware iscsi. See section
+@@ -613,13 +613,13 @@ To now log into targets it is the same a
+ 
+ 	    ./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
+ 
+-	This will search /etc/iscsi/send_targets for a record with the
++	This will search /var/lib/iscsi/send_targets for a record with the
+ 	ID [portal = 192.168.1.1:3260 and type = sendtargets. If found it
+ 	will perform discovery using the settings stored in the record.
+ 	If a record does not exist, it will be created using the iscsid.conf
+ 	discovery settings.
+ 
+-	For the ifaces, iscsiadm will first search /etc/iscsi/ifaces for
++	For the ifaces, iscsiadm will first search /var/lib/iscsi/ifaces for
+ 	interfaces using software iscsi. If any are found then nodes found
+ 	during discovery will be setup so that they can logged in through
+ 	those interfaces. To specify a specific iface, pass the
+@@ -675,7 +675,7 @@ To now log into targets it is the same a
  	This command will perform discovery, but not manipulate the node DB.
  
    - SendTargets iSCSI Discovery with a specific interface. If you
@@ -113,8 +154,8 @@ index 121bd45..c863044 100644
 +	wish to only use a subset of the interfaces in /var/lib/iscsi/ifaces
  	then you can pass them in during discovery:
  
- 	     ./iscsiadm -m discovery -t sendtargets -p 192.168.1.1:3260 \
-@@ -911,8 +911,8 @@ where targetname is the name of the target and ip_address:port is the address
+ 	     ./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
+@@ -982,8 +982,8 @@ where targetname is the name of the targ
  and port of the portal. tpgt, is the portal group tag of
  the portal, and is not used in iscsiadm commands except for static
  record creation. And iface name is the name of the iscsi interface
@@ -125,37 +166,20 @@ index 121bd45..c863044 100644
  Default here is iscsi_tcp/tcp to be used over which ever NIC the
  network layer decides is best.
  
-diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
-index b2bad47..6f1bac9 100644
---- a/doc/iscsiadm.8
-+++ 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:
+@@ -1098,7 +1098,7 @@ If set, iscsid will perform discovery to
+ discovery.isns.discoveryd_poll_inval or
+ discovery.sendtargets.discoveryd_poll_inval seconds,
+ and it will log into any portals found from the discovery source using
+-the ifaces in /etc/iscsi/ifaces.
++the ifaces in /var/lib/iscsi/ifaces.
+ 
+ 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:
  int idbm_init(idbm_get_config_file_fn *fn)
  {
  	/* make sure root db dir is there */
@@ -168,10 +192,10 @@ index 8ad8024..f5694f3 100644
  				   errno);
  			return errno;
  		}
-diff --git a/usr/idbm.h b/usr/idbm.h
-index 57b9295..44cb976 100644
---- a/usr/idbm.h
-+++ b/usr/idbm.h
+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
 @@ -27,12 +27,15 @@
  #include "initiator.h"
  #include "config.h"
@@ -192,12 +216,11 @@ index 57b9295..44cb976 100644
 +#define FW_CONFIG_DIR		ISCSIVAR"fw"
 +
  #define ST_CONFIG_NAME		"st_config"
+ #define ISNS_CONFIG_NAME	"isns_config"
  
- #define TYPE_INT	0
-diff --git a/usr/iface.h b/usr/iface.h
-index 9f6d47e..f7624ea 100644
---- a/usr/iface.h
-+++ b/usr/iface.h
+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
 @@ -20,7 +20,9 @@
  #ifndef ISCSI_IFACE_H
  #define ISCSI_IFACE_H
@@ -209,6 +232,3 @@ index 9f6d47e..f7624ea 100644
  
  struct iface_rec;
  struct list_head;
--- 
-1.6.6.1
-
diff --git a/iscsi-initiator-utils.spec b/iscsi-initiator-utils.spec
index e1221af..d900a72 100644
--- a/iscsi-initiator-utils.spec
+++ b/iscsi-initiator-utils.spec
@@ -3,39 +3,29 @@
 Summary: iSCSI daemon and utility programs
 Name: iscsi-initiator-utils
 Version: 6.2.0.872
-Release: 5%{?dist}
-Source0: http://people.redhat.com/mchristi/iscsi/rhel6.0/source/open-iscsi-2.0-872-rc1-bnx2i.tar.gz
+Release: 6%{?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
-# fw boot support
-Patch0: iscsi-initiator-utils-fw-boot.patch
 # Add Red Hat specific info to docs.
-Patch1: iscsi-initiator-utils-update-initscripts-and-docs.patch
+Patch0: iscsi-initiator-utils-update-initscripts-and-docs.patch
 # Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
-Patch2: iscsi-initiator-utils-use-var-for-config.patch
+Patch1: iscsi-initiator-utils-use-var-for-config.patch
 # Add redhat.com string to default initiator name.
-Patch3: iscsi-initiator-utils-use-red-hat-for-name.patch
+Patch2: iscsi-initiator-utils-use-red-hat-for-name.patch
 # Add a lib for use by anaconda.
-Patch4: iscsi-initiator-utils-add-libiscsi.patch
+Patch3: iscsi-initiator-utils-add-libiscsi.patch
 # Add bnx2i support.
-Patch5: iscsi-initiator-utils-uip-mgmt.patch
+Patch4: iscsi-initiator-utils-uip-mgmt.patch
 # disable isns for libiscsi (libiscsi does not support isns)
-Patch6: iscsi-initiator-utils-disable-isns-for-lib.patch
-# fix MaxXmitDataSegmentLength=0 handling
-Patch7: iscsi-initiator-utils-fix-zero-MaxXmitDataSegmentLength.patch
-# fix initial r2t handling for be2iscsi
-Patch8: iscsi-initiator-utils-be2iscsi-fix-init-r2t.patch
-# do not send informational msgs to stderr
-Patch9: iscsi-initiator-utils-log-info.patch
+Patch5: iscsi-initiator-utils-disable-isns-for-lib.patch
 # fix libiscsi get firmware sysfs init
-Patch10: iscsi-initiator-utils-fix-lib-sysfs-init.patch
+Patch6: iscsi-initiator-utils-fix-lib-sysfs-init.patch
 # fix race between uip and iscsid startup
-Patch11: iscsi-initiator-utils-fix-uip-init-race.patch
-# Fix discovery daemon iscsid shutdown
-Patch12: iscsi-initiator-utils-fix-dd-stop.patch
+Patch7: iscsi-initiator-utils-fix-uip-init-race.patch
 # Don't compile iscsistart as static
-Patch13: iscsi-initiator-utils-dont-use-static.patch
+Patch8: iscsi-initiator-utils-dont-use-static.patch
 
 Group: System Environment/Daemons
 License: GPLv2+
@@ -62,21 +52,16 @@ The %{name}-devel package contains libraries and header files for
 developing applications that use %{name}.
 
 %prep
-%setup -q -n open-iscsi-2.0-872-rc1-bnx2i
-%patch0 -p1 -b .fw-boot
-%patch1 -p1 -b .update-initscripts-and-docs
-%patch2 -p1 -b .use-var-for-config
-%patch3 -p1 -b .use-red-hat-for-name
-%patch4 -p1 -b .add-libiscsi
-%patch5 -p1 -b .uip-mgmt
-%patch6 -p1 -b .disable-isns-for-lib
-%patch7 -p1 -b .fix-zero-MaxXmitDataSegmentLength
-%patch8 -p1 -b .be2iscsi-fix-init-r2t
-%patch9 -p1 -b .log-info
-%patch10 -p1 -b .fix-lib-sysfs-init
-%patch11 -p1 -b .fix-uip-init-race
-%patch12 -p1 -b .fix-dd-stop
-%patch13 -p1 -b .dont-use-static
+%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
 
 %build
 cd utils/open-isns
@@ -195,6 +180,12 @@ fi
 %{_includedir}/libiscsi.h
 
 %changelog
+* Thu Jul 8 2010 Mike Christie <mchristi at redhat.com> 6.2.0.872.6
+- 602899 Add discovery db support.
+- 595591 Sync brcm_iscsiuio to 0.5.15.
+- 589256 Do not log success message and return ENODEV
+- 601434 Fix iscsiadm handling of non-default port
+
 * Fri Jun 18 2010 Mike Christie <mchristi at redhat.com> 6.2.0.872.5
 - 602286 No need to compile iscsistart as static. This also fixes
   the segfault when hostnames are passed in for the portal ip.
diff --git a/iscsid.init b/iscsid.init
index 7095a37..227101a 100755
--- a/iscsid.init
+++ b/iscsid.init
@@ -49,11 +49,17 @@ force_start() {
 }
 
 use_discoveryd() {
-    if [ -z "grep "discovery.daemon" $config | sed '/^ *#/d'" ] ; then
-	return 1
+    grep -qrs "discovery.sendtargets.use_discoveryd = Yes" /var/lib/iscsi/send_targets
+    if [ $? -eq 0 ] ; then
+ 	return 0
     fi
 
-    return 0
+    grep -qrs "discovery.isns.use_discoveryd = Yes" /var/lib/iscsi/isns
+    if [ $? -eq 0 ] ; then
+ 	return 0
+    fi
+
+    return 1
 }
 
 start() {
diff --git a/sources b/sources
index bf470f3..a1945c6 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-47b83f17310664cda129045596f9058c  open-iscsi-2.0-872-rc1-bnx2i.tar.gz
+fdc3d1fd718a6f5e4281db84c993a5e2  open-iscsi-2.0-872-rc4-bnx2i.tar.gz


More information about the scm-commits mailing list