Reset content to fedora 19 branch

This commit is contained in:
Chris Leech 2013-06-17 10:58:51 -07:00
commit 1efedd2bdd
57 changed files with 2760 additions and 124674 deletions

10
.gitignore vendored
View File

@ -1,8 +1,2 @@
/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
/open-iscsi-2.0-873.tar.gz
/iscsiuio-0.7.2.1.tar.gz

View File

@ -1,7 +1,7 @@
From bc6380ddce06ae2ce9a5b4f2952879175ba47c06 Mon Sep 17 00:00:00 2001
From 71cd021b74a7094b5186a42bfe59a35e2fa66018 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Wed, 5 Sep 2012 16:18:16 -0500
Subject: [PATCH 1/4] iscsid: fix iscsid segfault during qla4xxx login
Subject: iscsid: fix iscsid segfault during qla4xxx login
If the kernel sends multiple ISCSI_KEVENT_CONN_LOGIN_STATE
events for the same login event iscsid will segault.
@ -16,10 +16,10 @@ call mgmt_ipc_write_rsp on a bad qtask.
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/usr/initiator.c b/usr/initiator.c
index c9d792e..597e0ff 100644
index 79ca32c..d475358 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -1041,7 +1041,7 @@ static void session_scan_host(struct iscsi_session *session, int hostno,
@@ -993,7 +993,7 @@ static void session_scan_host(struct iscsi_session *session, int hostno,
exit(0);
} else if (pid > 0) {
reap_inc();
@ -28,7 +28,7 @@ index c9d792e..597e0ff 100644
close(qtask->mgmt_ipc_fd);
free(qtask);
}
@@ -1666,6 +1666,9 @@ static void session_conn_process_login(void *data)
@@ -1618,6 +1618,9 @@ static void session_conn_process_login(void *data)
if (state == ISCSI_CONN_STATE_FREE)
goto failed_login;
@ -39,5 +39,5 @@ index c9d792e..597e0ff 100644
/*
* ok we were in_login and now we got the notification that we are
--
1.7.11.4
1.7.11.7

View File

@ -1,8 +1,7 @@
From 81225b1134210be0a58bec6e2532267e42b4ada2 Mon Sep 17 00:00:00 2001
From f0a8c95426d21413d9980d31740e193208e3280e Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Wed, 5 Sep 2012 14:14:20 -0700
Subject: [PATCH 2/4] ISCSISTART: Bring up the corresponding network interface
for iboot
Subject: ISCSISTART: Bring up the corresponding network interface for iboot
This is needed for the iSCSI offload boot.
@ -19,10 +18,10 @@ Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
1 file changed, 4 insertions(+)
diff --git a/usr/iface.c b/usr/iface.c
index 4c612af..0f6b6d1 100644
index 3a9582e..4028e34 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -915,6 +915,10 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
@@ -917,6 +917,10 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
transport_name))
t = iscsi_sysfs_get_transport_by_name(transport_name);
@ -34,5 +33,5 @@ index 4c612af..0f6b6d1 100644
&rc);
if (rc) {
--
1.7.11.4
1.7.11.7

View File

@ -0,0 +1,35 @@
From d81fd4903cebb1d00aa48b0718d20e34b00dfde1 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Wed, 26 Sep 2012 21:19:39 -0500
Subject: iscsi tools: fix compile error when OFFLOAD_BOOT_SUPPORT defined
Fix compile error when OFFLOAD_BOOT_SUPPORT is defined and fix
warning when it is defined.
---
usr/iface.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/usr/iface.c b/usr/iface.c
index 4028e34..4f81a76 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -894,7 +894,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
struct boot_context *context)
{
struct iscsi_transport *t = NULL;
- char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
uint32_t hostno;
if (strlen(context->initiatorname))
@@ -910,6 +909,8 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
} else if (strlen(context->iface)) {
/* this ifdef is only temp until distros and firmwares are updated */
#ifdef OFFLOAD_BOOT_SUPPORTED
+ char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
+ int rc;
memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN);
/* make sure offload driver is loaded */
--
1.7.11.7

View File

@ -0,0 +1,32 @@
From 13d08e79090421fbf67fd727aada487ea23ecc2d Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Thu, 27 Sep 2012 13:57:12 -0700
Subject: ISCSID: Passing more net params from ibft to iface
Added the passing of the vlan_id, subnet_mask, and gateway attributes
from the ibft context to the iface struct for the connection request.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
usr/iface.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/usr/iface.c b/usr/iface.c
index 4f81a76..c86892e 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -962,6 +962,11 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
sizeof(iface->hwaddress));
strlcpy(iface->ipaddress, context->ipaddr,
sizeof(iface->ipaddress));
+ iface->vlan_id = atoi(context->vlan);
+ strlcpy(iface->subnet_mask, context->mask,
+ sizeof(iface->subnet_mask));
+ strlcpy(iface->gateway, context->gateway,
+ sizeof(iface->gateway));
log_debug(1, "iface " iface_fmt "\n", iface_str(iface));
return 1;
}
--
1.7.11.7

View File

@ -0,0 +1,62 @@
From 9dd181dcb1ca299cd82075b8e598fc57d87ee1c0 Mon Sep 17 00:00:00 2001
From: Jim Ramsay <jim_ramsay@dell.com>
Date: Wed, 3 Oct 2012 09:57:43 -0400
Subject: iscsi tools: Convert '-r' argument to an integer before checking if
it is a path
If there is a file in the CWD named '1' and you were trying to run
'iscsiadm -m session -r 1 ...', the command would fail with "1 is not a
directory".
Root cause: The code that parses the -r option's argument tries lstat(2)
first, falling back to atoi(3) only if lstat fails.
This change inverts the order of checks, first with strtol(3) to see if
the argument given is a positive integer, then falling back to lstat(2)
only if it is not.
Signed-off-by: Jim Ramsay <jim_ramsay@dell.com>
---
usr/iscsi_sysfs.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 123dde3..4015b35 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -740,7 +740,7 @@ int iscsi_sysfs_session_has_leadconn(uint32_t sid)
* /sys/devices/platform/hostH/sessionS/targetH:B:I
* /sys/devices/platform/hostH/sessionS
*
- * return the sid S. If just the sid is passed in it will be covnerted
+ * return the sid S. If just the sid is passed in it will be converted
* to a int.
*/
int iscsi_sysfs_get_sid_from_path(char *session)
@@ -748,15 +748,16 @@ int iscsi_sysfs_get_sid_from_path(char *session)
struct sysfs_device *dev_parent, *dev;
struct stat statb;
char devpath[PATH_SIZE];
+ char *end;
+ int sid;
+
+ sid = strtol(session, &end, 10);
+ if (sid > 0 && *session != '\0' && *end == '\0')
+ return sid;
if (lstat(session, &statb)) {
- log_debug(1, "Could not stat %s failed with %d",
- session, errno);
- if (index(session, '/')) {
- log_error("%s is an invalid session path\n", session);
- exit(1);
- }
- return atoi(session);
+ log_error("%s is an invalid session ID or path\n", session);
+ exit(1);
}
if (!S_ISDIR(statb.st_mode) && !S_ISLNK(statb.st_mode)) {
--
1.7.11.7

View File

@ -0,0 +1,49 @@
From 97db3db45c7e96888ea48a54ff19b7ff5d08cca6 Mon Sep 17 00:00:00 2001
From: Andy Grover <agrover@redhat.com>
Date: Wed, 24 Oct 2012 15:37:28 -0700
Subject: Update README for removal of DBM requirement
Removed in 093b1f4 (2006)
Signed-off-by: Andy Grover <agrover@redhat.com>
---
README | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/README b/README
index 7364b2d..ec22098 100644
--- a/README
+++ b/README
@@ -159,15 +159,20 @@ Usage: iscsid [OPTION]
5. Open-iSCSI Configuration Utility
===================================
-Open-iSCSI persistent configuration is implemented as a DBM database
-available on all Linux installations.
-
-The database contains two tables:
-
-- Discovery table (/etc/iscsi/send_targets);
-- Node table (/etc/iscsi/nodes).
-
-The regular place for iSCSI database files: /etc/iscsi/nodes
+Open-iSCSI persistent configuration is stored in a number of
+directories under a configuration root directory, using a flat-file
+format. This configuration root directory is /etc/iscsi by default,
+but may also commonly be in /var/lib/iscsi.
+
+Configuration is contained in directories for:
+
+- nodes
+- slp
+- isns
+- static
+- fw
+- send_targets
+- ifaces
The iscsiadm utility is a command-line tool to manage (update, delete,
insert, query) the persistent database.
--
1.7.11.7

View File

@ -0,0 +1,80 @@
From 2d086a831dc16d10729d6fce17bed3ade3efd16c Mon Sep 17 00:00:00 2001
From: Tomasz Torcz <tomek@pipebreaker.pl>
Date: Wed, 28 Nov 2012 13:37:06 +0100
Subject: iscsid,iscsiadm: fix abstract socket length in bind() call
For abstract sockets, the addrlen parameter should be the actual
length of socket's name. Otherwise socket gets padded with some
number of NULs.
---
usr/iscsid_req.c | 10 ++++++----
usr/mgmt_ipc.c | 9 +++++----
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 0902011..1c4678d 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -56,7 +56,7 @@ static void iscsid_startup(void)
static int iscsid_connect(int *fd, int start_iscsid)
{
- int nsec;
+ int nsec, addr_len;
struct sockaddr_un addr;
*fd = socket(AF_LOCAL, SOCK_STREAM, 0);
@@ -65,15 +65,17 @@ static int iscsid_connect(int *fd, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1;
+
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, ISCSIADM_NAMESPACE, addr_len);
+
/*
* Trying to connect with exponential backoff
*/
for (nsec = 1; nsec <= MAXSLEEP; nsec <<= 1) {
- if (connect(*fd, (struct sockaddr *) &addr, sizeof(addr)) == 0)
+ if (connect(*fd, (struct sockaddr *) &addr, addr_len) == 0)
/* Connection established */
return ISCSI_SUCCESS;
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
index 5c39c2e..a1dafc9 100644
--- a/usr/mgmt_ipc.c
+++ b/usr/mgmt_ipc.c
@@ -43,7 +43,7 @@
int
mgmt_ipc_listen(void)
{
- int fd, err;
+ int fd, err, addr_len;
struct sockaddr_un addr;
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
@@ -52,12 +52,13 @@ mgmt_ipc_listen(void)
return fd;
}
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1;
+
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, ISCSIADM_NAMESPACE, addr_len);
- if ((err = bind(fd, (struct sockaddr *) &addr, sizeof(addr))) < 0) {
+ if ((err = bind(fd, (struct sockaddr *) &addr, addr_len)) < 0 ) {
log_error("Can not bind IPC socket");
close(fd);
return err;
--
1.7.11.7

View File

@ -0,0 +1,79 @@
From 5d0e19fcc1cea77a72647cf96c5d3d773e8ee277 Mon Sep 17 00:00:00 2001
From: Tomasz Torcz <tomek@pipebreaker.pl>
Date: Wed, 28 Nov 2012 13:37:07 +0100
Subject: iscsid: implement systemd-compatible socket activation
---
usr/mgmt_ipc.c | 29 +++++++++++++++++++++++++++++
usr/mgmt_ipc.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
index a1dafc9..87bd346 100644
--- a/usr/mgmt_ipc.c
+++ b/usr/mgmt_ipc.c
@@ -39,6 +39,7 @@
#define PEERUSER_MAX 64
#define EXTMSG_MAX (64 * 1024)
+#define SD_SOCKET_FDS_START 3
int
mgmt_ipc_listen(void)
@@ -46,6 +47,12 @@ mgmt_ipc_listen(void)
int fd, err, addr_len;
struct sockaddr_un addr;
+ /* first check if we have fd handled by systemd */
+ fd = mgmt_ipc_systemd();
+ if (fd >= 0)
+ return fd;
+
+ /* manually establish a socket */
fd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (fd < 0) {
log_error("Can not create IPC socket");
@@ -73,6 +80,28 @@ mgmt_ipc_listen(void)
return fd;
}
+int mgmt_ipc_systemd(void)
+{
+ const char *env;
+
+ env = getenv("LISTEN_PID");
+
+ if (!env || (strtoul(env, NULL, 10) != getpid()))
+ return -EINVAL;
+
+ env = getenv("LISTEN_FDS");
+
+ if (!env)
+ return -EINVAL;
+
+ if (strtoul(env, NULL, 10) != 1) {
+ log_error("Did not receive exactly one IPC socket from systemd");
+ return -EINVAL;
+ }
+
+ return SD_SOCKET_FDS_START;
+}
+
void
mgmt_ipc_close(int fd)
{
diff --git a/usr/mgmt_ipc.h b/usr/mgmt_ipc.h
index 7d8ce72..55972ed 100644
--- a/usr/mgmt_ipc.h
+++ b/usr/mgmt_ipc.h
@@ -112,6 +112,7 @@ typedef int mgmt_ipc_fn_t(struct queue_task *);
struct queue_task;
void mgmt_ipc_write_rsp(struct queue_task *qtask, int err);
int mgmt_ipc_listen(void);
+int mgmt_ipc_systemd(void);
void mgmt_ipc_close(int fd);
void mgmt_ipc_handle(int accept_fd);
--
1.7.11.7

View File

@ -0,0 +1,54 @@
From c34e0bdcbafdb6f9304e1474d51fe1c789c5dea2 Mon Sep 17 00:00:00 2001
From: Tomasz Torcz <tomek@pipebreaker.pl>
Date: Wed, 28 Nov 2012 13:37:08 +0100
Subject: iscsid: add example unit files for systemd
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Those two units, based on the work by Jóhann B. Guðmundsson, exploit
on-demand socket activation in iscsid.
---
etc/systemd/iscsid.service | 13 +++++++++++++
etc/systemd/iscsid.socket | 9 +++++++++
2 files changed, 22 insertions(+)
create mode 100644 etc/systemd/iscsid.service
create mode 100644 etc/systemd/iscsid.socket
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
new file mode 100644
index 0000000..028e0b3
--- /dev/null
+++ b/etc/systemd/iscsid.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Open-iSCSI
+Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
+After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/iscsid.pid
+ExecStart=/usr/sbin/iscsid
+ExecStop=/sbin/iscsiadm -k 0 2
+
+[Install]
+WantedBy=multi-user.target
diff --git a/etc/systemd/iscsid.socket b/etc/systemd/iscsid.socket
new file mode 100644
index 0000000..832451d
--- /dev/null
+++ b/etc/systemd/iscsid.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Open-iSCSI iscsid Socket
+Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
+
+[Socket]
+ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
+
+[Install]
+WantedBy=sockets.target
--
1.7.11.7

View File

@ -0,0 +1,61 @@
From a7afdf46c3193eb102cc6ec2a3b61e8d36794437 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Fri, 14 Dec 2012 12:40:27 -0600
Subject: iscsi tools: fix get_random_bytes error handling
Bug report from Rahul:
There seems to be a bug in function get_random_bytes(). I reported
this earlier as well but somehow it didn't appear here.
get_random_bytes(unsigned char *data, unsigned int length)
{
long r;
unsigned n;
int fd;
fd = open("/dev/urandom", O_RDONLY);
while (length > 0) {
if (!fd || read(fd, &r, sizeof(long)) != -1) <<<< the condition is
incorrect
---
usr/auth.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/usr/auth.c b/usr/auth.c
index c924545..4ff0425 100644
--- a/usr/auth.c
+++ b/usr/auth.c
@@ -189,24 +189,24 @@ get_random_bytes(unsigned char *data, unsigned int length)
long r;
unsigned n;
- int fd;
+ int fd, r_size = sizeof(r);
fd = open("/dev/urandom", O_RDONLY);
while (length > 0) {
- if (!fd || read(fd, &r, sizeof(long)) != -1)
+ if (fd == -1 || read(fd, &r, r_size) != r_size)
r = rand();
r = r ^ (r >> 8);
r = r ^ (r >> 4);
n = r & 0x7;
- if (!fd || read(fd, &r, sizeof(long)) != -1)
+ if (fd == -1 || read(fd, &r, r_size) != r_size)
r = rand();
r = r ^ (r >> 8);
r = r ^ (r >> 5);
n = (n << 3) | (r & 0x7);
- if (!fd || read(fd, &r, sizeof(long)) != -1)
+ if (fd == -1 || read(fd, &r, r_size) != r_size)
r = rand();
r = r ^ (r >> 8);
r = r ^ (r >> 5);
--
1.7.11.7

View File

@ -0,0 +1,61 @@
From b1799fe84ed94a19bba6bcd7284ce8b038be4ffe Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 10 Dec 2012 13:20:47 -0800
Subject: iscsid: add --initrd option to set run from initrd hint for systemd
See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
Signed-off-by: Chris Leech <cleech@redhat.com>
---
usr/iscsid.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/usr/iscsid.c b/usr/iscsid.c
index b4bb65b..7d71085 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -61,6 +61,7 @@ static pid_t log_pid;
static gid_t gid;
static int daemonize = 1;
static int mgmt_ipc_fd;
+static int initrd = 0;
static struct option const long_options[] = {
{"config", required_argument, NULL, 'c'},
@@ -73,6 +74,7 @@ static struct option const long_options[] = {
{"pid", required_argument, NULL, 'p'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'v'},
+ {"initrd", no_argument, &initrd, 1},
{NULL, 0, NULL, 0},
};
@@ -95,6 +97,7 @@ Open-iSCSI initiator daemon.\n\
-p, --pid=pidfile use pid file (default " PID_FILE ").\n\
-h, --help display this help and exit\n\
-v, --version display version and exit\n\
+ --initrd run from initrd\n\
");
}
exit(status);
@@ -383,12 +386,17 @@ int main(int argc, char *argv[])
case 'h':
usage(0);
break;
+ case 0:
+ break;
default:
usage(1);
break;
}
}
+ if (initrd)
+ argv[0][0] = '@';
+
/* initialize logger */
log_pid = log_init(program_name, DEFAULT_AREA_SIZE,
daemonize ? log_do_log_daemon : log_do_log_std, NULL);
--
1.7.11.7

View File

@ -0,0 +1,157 @@
From ac3447ab680ef5319717fc6b85a4c5b22e652e5e Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Fri, 7 Dec 2012 17:01:42 -0800
Subject: iscsiadm, iscsid: newroot command to survive switch_root
When started from initramfs, iscsid needs to be able to chroot itself
to the runtime filesystem before the switch_root occurs. In the
initramfs "iscsiadm --newroot {root fs mount before switch}" should be
called before the switch_root.
Signed-off-by: Chris Leech <cleech@redhat.com>
---
usr/iscsiadm.c | 30 ++++++++++++++++++++++++++++++
usr/mgmt_ipc.c | 11 +++++++++++
usr/mgmt_ipc.h | 6 +++++-
3 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 8f9de05..323d0a8 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -111,6 +111,7 @@ static struct option const long_options[] =
{"packetsize", required_argument, NULL, 'b'},
{"count", required_argument, NULL, 'c'},
{"interval", required_argument, NULL, 'i'},
+ {"newroot", required_argument, NULL, 0},
{NULL, 0, NULL, 0},
};
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:u";
@@ -131,6 +132,7 @@ iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\
iscsiadm -m fw [ -l ]\n\
iscsiadm -m host [ -P printlevel ] [ -H hostno|MAC ] [ -C chap [ -o operation ] [ -v chap_tbl_idx ] ]\n\
+iscsiadm --newroot switch_root_path\n\
iscsiadm -k priority\n");
}
exit(status);
@@ -251,6 +253,22 @@ static void kill_iscsid(int priority)
}
}
+static void do_newroot(char *newroot)
+{
+ iscsiadm_req_t req;
+ iscsiadm_rsp_t rsp;
+ int rc;
+
+ memset(&req, 0, sizeof(req));
+ req.command = MGMT_IPC_NEWROOT;
+ strncpy(req.u.newroot.path, newroot, PATH_MAX);
+ rc = iscsid_exec_req(&req, &rsp, 0);
+ if (rc) {
+ iscsi_err_print_msg(rc);
+ log_error("Could not send NEWROOT command");
+ }
+}
+
/*
* TODO: we can display how the ifaces are related to node records.
* And we can add a scsi_host mode which would display how
@@ -2397,6 +2415,7 @@ main(int argc, char **argv)
{
char *ip = NULL, *name = NULL, *value = NULL;
char *targetname = NULL, *group_session_mgmt_mode = NULL;
+ char *newroot = NULL;
int ch, longindex, mode=-1, port=-1, do_login=0, do_rescan=0;
int rc=0, sid=-1, op=OP_NOOP, type=-1, do_logout=0, do_stats=0;
int do_login_all=0, do_logout_all=0, info_level=-1, num_ifaces = 0;
@@ -2433,6 +2452,12 @@ main(int argc, char **argv)
while ((ch = getopt_long(argc, argv, short_options,
long_options, &longindex)) >= 0) {
switch (ch) {
+ case 0:
+ if (long_options[longindex].flag != 0)
+ break;
+ if (!strcmp(long_options[longindex].name, "newroot"))
+ newroot = optarg;
+ break;
case 'k':
killiscsid = atoi(optarg);
if (killiscsid < 0) {
@@ -2579,6 +2604,11 @@ main(int argc, char **argv)
goto free_ifaces;
}
+ if (newroot) {
+ do_newroot(newroot);
+ goto free_ifaces;
+ }
+
if (mode < 0)
usage(ISCSI_ERR_INVAL);
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
index 87bd346..5cb7143 100644
--- a/usr/mgmt_ipc.c
+++ b/usr/mgmt_ipc.c
@@ -226,6 +226,16 @@ mgmt_ipc_immediate_stop(queue_task_t *qtask)
}
static int
+mgmt_ipc_newroot(queue_task_t *qtask)
+{
+ char *newroot = qtask->req.u.newroot.path;
+ if (chdir(newroot) || chroot(".") || chdir("/"))
+ return ISCSI_ERR;
+ mgmt_ipc_write_rsp(qtask, ISCSI_SUCCESS);
+ return ISCSI_SUCCESS;
+}
+
+static int
mgmt_ipc_conn_remove(queue_task_t *qtask)
{
return ISCSI_ERR;
@@ -534,6 +544,7 @@ static mgmt_ipc_fn_t * mgmt_ipc_functions[__MGMT_IPC_MAX_COMMAND] = {
[MGMT_IPC_NOTIFY_DEL_NODE] = mgmt_ipc_notify_del_node,
[MGMT_IPC_NOTIFY_ADD_PORTAL] = mgmt_ipc_notify_add_portal,
[MGMT_IPC_NOTIFY_DEL_PORTAL] = mgmt_ipc_notify_del_portal,
+[MGMT_IPC_NEWROOT] = mgmt_ipc_newroot,
};
void mgmt_ipc_handle(int accept_fd)
diff --git a/usr/mgmt_ipc.h b/usr/mgmt_ipc.h
index 55972ed..102ffff 100644
--- a/usr/mgmt_ipc.h
+++ b/usr/mgmt_ipc.h
@@ -22,6 +22,7 @@
#include "types.h"
#include "iscsi_if.h"
#include "config.h"
+#include "limits.h"
#define ISCSIADM_NAMESPACE "ISCSIADM_ABSTRACT_NAMESPACE"
#define PEERUSER_MAX 64
@@ -46,6 +47,7 @@ typedef enum iscsiadm_cmd {
MGMT_IPC_NOTIFY_DEL_NODE = 17,
MGMT_IPC_NOTIFY_ADD_PORTAL = 18,
MGMT_IPC_NOTIFY_DEL_PORTAL = 19,
+ MGMT_IPC_NEWROOT = 20,
__MGMT_IPC_MAX_COMMAND
} iscsiadm_cmd_e;
@@ -75,8 +77,10 @@ typedef struct iscsiadm_req {
int param;
/* TODO: make this variable len to support */
char value[IFNAMSIZ + 1];
-
} set_host_param;
+ struct ipc_msg_newroot {
+ char path[PATH_MAX + 1];
+ } newroot;
} u;
} iscsiadm_req_t;
--
1.7.11.7

View File

@ -0,0 +1,337 @@
From a41a27cd9b910191a616706c4f473259909bc45d Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 18 Dec 2012 11:27:00 -0800
Subject: iscsiadm: --param parsing for advanced node creation
Share parse_param and apply_param code from iscsistart, allow using multiple
--param options to set arbitrary fields in node mode.
Signed-off-by: Chris Leech <cleech@redhat.com>
---
usr/Makefile | 2 +-
usr/iscsi_param.c | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
usr/iscsi_param.h | 7 ++++
usr/iscsiadm.c | 16 ++++++++--
usr/iscsistart.c | 91 ++--------------------------------------------------
5 files changed, 120 insertions(+), 91 deletions(-)
create mode 100644 usr/iscsi_param.c
create mode 100644 usr/iscsi_param.h
diff --git a/usr/Makefile b/usr/Makefile
index 673b7f1..1506111 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -40,7 +40,7 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o)
ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
iscsi_net_util.o iscsid_req.o transport.o iser.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o $(IPC_OBJ) $(SYSDEPS_SRCS)
+ initiator_common.o iscsi_err.o iscsi_param.o $(IPC_OBJ) $(SYSDEPS_SRCS)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o
diff --git a/usr/iscsi_param.c b/usr/iscsi_param.c
new file mode 100644
index 0000000..c075e8f
--- /dev/null
+++ b/usr/iscsi_param.c
@@ -0,0 +1,95 @@
+#include <string.h>
+#include "log.h"
+#include "config.h"
+#include "idbm.h"
+#include "list.h"
+#include "iface.h"
+#include "idbm_fields.h"
+#include "iscsi_err.h"
+
+int apply_params(struct list_head *user_params, struct node_rec *rec)
+{
+ struct user_param *param;
+ int rc;
+
+ /* Must init this so we can check if user overrode them */
+ rec->session.initial_login_retry_max = -1;
+ rec->conn[0].timeo.noop_out_interval = -1;
+ rec->conn[0].timeo.noop_out_timeout = -1;
+
+ list_for_each_entry(param, user_params, list) {
+ /*
+ * user may not have passed in all params that were set by
+ * ibft/iscsi_boot, so clear out values that might conflict
+ * with user overrides
+ */
+ if (!strcmp(param->name, IFACE_NETNAME)) {
+ /* overriding netname so MAC will be for old netdev */
+ memset(rec->iface.hwaddress, 0,
+ sizeof(rec->iface.hwaddress));
+ } else if (!strcmp(param->name, IFACE_HWADDR)) {
+ /* overriding MAC so netdev will be for old MAC */
+ memset(rec->iface.netdev, 0, sizeof(rec->iface.netdev));
+ } else if (!strcmp(param->name, IFACE_TRANSPORTNAME)) {
+ /*
+ * switching drivers so all old binding info is no
+ * longer valid. Old values were either for offload
+ * and we are switching to software or the reverse,
+ * or switching types of cards (bnx2i to cxgb3i).
+ */
+ memset(&rec->iface, 0, sizeof(rec->iface));
+ iface_setup_defaults(&rec->iface);
+ }
+ }
+
+ rc = idbm_node_set_rec_from_param(user_params, rec, 0);
+ if (rc)
+ return rc;
+
+ /*
+ * For root boot we could not change this in older versions so
+ * if user did not override then use the defaults.
+ *
+ * Increase to account for boot using static setup.
+ */
+ if (rec->session.initial_login_retry_max == -1)
+ rec->session.initial_login_retry_max = 30;
+ /* we used to not be able to answer so turn off */
+ if (rec->conn[0].timeo.noop_out_interval == -1)
+ rec->conn[0].timeo.noop_out_interval = 0;
+ if (rec->conn[0].timeo.noop_out_timeout == -1)
+ rec->conn[0].timeo.noop_out_timeout = 0;
+
+ return 0;
+}
+
+int parse_param(struct list_head *user_params, char *param_str)
+{
+ struct user_param *param;
+ char *name, *value;
+
+ name = param_str;
+
+ value = strchr(param_str, '=');
+ if (!value) {
+ log_error("Invalid --param %s. Missing value.", param_str);
+ return ISCSI_ERR_INVAL;
+ }
+ *value = '\0';
+
+ value++;
+ if (!strlen(value)) {
+ log_error("Invalid --param %s. Missing value.", param_str);
+ return ISCSI_ERR_INVAL;
+ }
+
+ param = idbm_alloc_user_param(name, value);
+ if (!param) {
+ log_error("Could not allocate memory for param.");
+ return ISCSI_ERR_NOMEM;
+ }
+
+ list_add(&param->list, user_params);
+ return 0;
+}
+
diff --git a/usr/iscsi_param.h b/usr/iscsi_param.h
new file mode 100644
index 0000000..8b7956c
--- /dev/null
+++ b/usr/iscsi_param.h
@@ -0,0 +1,7 @@
+#ifndef ISCSI_PARAM_H
+#define ISCSI_PARAM_H
+
+extern int parse_param(struct list_head *user_params, char *param_str);
+extern int apply_params(struct list_head *user_params, struct node_rec *rec);
+
+#endif
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 323d0a8..ef866ae 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -53,6 +53,7 @@
#include "iscsi_err.h"
#include "iscsi_ipc.h"
#include "iscsi_timer.h"
+#include "iscsi_param.h"
static char program_name[] = "iscsiadm";
static char config_file[TARGET_NAME_MAXLEN];
@@ -112,6 +113,7 @@ static struct option const long_options[] =
{"count", required_argument, NULL, 'c'},
{"interval", required_argument, NULL, 'i'},
{"newroot", required_argument, NULL, 0},
+ {"param", required_argument, NULL, 0},
{NULL, 0, NULL, 0},
};
static char *short_options = "RlDVhm:a:b:c:C:p:P:T:H:i:I:U:k:L:d:r:n:v:o:sSt:u";
@@ -127,7 +129,7 @@ iscsiadm -m discoverydb [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p
[ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] \n\
iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] \n\
iscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] \
-[ [ -o operation ] [ -n name ] [ -v value ] ]\n\
+[ [ -o operation ] [ -n name ] [ -v value ] ] [ --param=NAME=VALUE ]\n\
iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]\n\
iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename | -H hostno|MAC ] [ [ -o operation ] [ -n name ] [ -v value ] ] [ -C ping [ -a ip ] [ -b packetsize ] [ -c count ] [ -i interval ] ]\n\
iscsiadm -m fw [ -l ]\n\
@@ -2430,9 +2432,11 @@ main(int argc, char **argv)
uint32_t host_no = -1;
struct user_param *param;
struct list_head params;
+ struct list_head user_params;
INIT_LIST_HEAD(&params);
INIT_LIST_HEAD(&ifaces);
+ INIT_LIST_HEAD(&user_params);
/* do not allow ctrl-c for now... */
memset(&sa_old, 0, sizeof(struct sigaction));
memset(&sa_new, 0, sizeof(struct sigaction));
@@ -2455,8 +2459,14 @@ main(int argc, char **argv)
case 0:
if (long_options[longindex].flag != 0)
break;
- if (!strcmp(long_options[longindex].name, "newroot"))
+ if (!strcmp(long_options[longindex].name, "newroot")) {
newroot = optarg;
+ break;
+ }
+ if (!strcmp(long_options[longindex].name, "param")) {
+ parse_param(&user_params, optarg);
+ break;
+ }
break;
case 'k':
killiscsid = atoi(optarg);
@@ -2748,6 +2758,8 @@ main(int argc, char **argv)
goto out;
}
+ apply_params(&user_params, rec);
+
rc = exec_node_op(op, do_login, do_logout, do_show,
do_rescan, do_stats, info_level, rec,
&params);
diff --git a/usr/iscsistart.c b/usr/iscsistart.c
index 6924d49..85be35b 100644
--- a/usr/iscsistart.c
+++ b/usr/iscsistart.c
@@ -50,6 +50,7 @@
#include "iscsid_req.h"
#include "iscsi_err.h"
#include "iface.h"
+#include "iscsi_param.h"
/* global config info */
/* initiator needs initiator name/alias */
@@ -131,99 +132,13 @@ static int stop_event_loop(void)
return rc;
}
-static int apply_params(struct node_rec *rec)
-{
- struct user_param *param;
- int rc;
-
- /* Must init this so we can check if user overrode them */
- rec->session.initial_login_retry_max = -1;
- rec->conn[0].timeo.noop_out_interval = -1;
- rec->conn[0].timeo.noop_out_timeout = -1;
-
- list_for_each_entry(param, &user_params, list) {
- /*
- * user may not have passed in all params that were set by
- * ibft/iscsi_boot, so clear out values that might conflict
- * with user overrides
- */
- if (!strcmp(param->name, IFACE_NETNAME)) {
- /* overriding netname so MAC will be for old netdev */
- memset(rec->iface.hwaddress, 0,
- sizeof(rec->iface.hwaddress));
- } else if (!strcmp(param->name, IFACE_HWADDR)) {
- /* overriding MAC so netdev will be for old MAC */
- memset(rec->iface.netdev, 0, sizeof(rec->iface.netdev));
- } else if (!strcmp(param->name, IFACE_TRANSPORTNAME)) {
- /*
- * switching drivers so all old binding info is no
- * longer valid. Old values were either for offload
- * and we are switching to software or the reverse,
- * or switching types of cards (bnx2i to cxgb3i).
- */
- memset(&rec->iface, 0, sizeof(rec->iface));
- iface_setup_defaults(&rec->iface);
- }
- }
-
- rc = idbm_node_set_rec_from_param(&user_params, rec, 0);
- if (rc)
- return rc;
-
- /*
- * For root boot we could not change this in older versions so
- * if user did not override then use the defaults.
- *
- * Increase to account for boot using static setup.
- */
- if (rec->session.initial_login_retry_max == -1)
- rec->session.initial_login_retry_max = 30;
- /* we used to not be able to answer so turn off */
- if (rec->conn[0].timeo.noop_out_interval == -1)
- rec->conn[0].timeo.noop_out_interval = 0;
- if (rec->conn[0].timeo.noop_out_timeout == -1)
- rec->conn[0].timeo.noop_out_timeout = 0;
-
- return 0;
-}
-
-static int parse_param(char *param_str)
-{
- struct user_param *param;
- char *name, *value;
-
- name = param_str;
-
- value = strchr(param_str, '=');
- if (!value) {
- log_error("Invalid --param %s. Missing value.", param_str);
- return ISCSI_ERR_INVAL;
- }
- *value = '\0';
-
- value++;
- if (!strlen(value)) {
- log_error("Invalid --param %s. Missing value.", param_str);
- return ISCSI_ERR_INVAL;
- }
-
- param = idbm_alloc_user_param(name, value);
- if (!param) {
- log_error("Could not allocate memory for param.");
- return ISCSI_ERR_NOMEM;
- }
-
- list_add(&param->list, &user_params);
- return 0;
-}
-
static int login_session(struct node_rec *rec)
{
iscsiadm_req_t req;
iscsiadm_rsp_t rsp;
int rc, retries = 0;
- rc = apply_params(rec);
+ rc = apply_params(&user_params, rec);
if (rc)
return rc;
@@ -426,7 +341,7 @@ int main(int argc, char *argv[])
fw_free_targets(&targets);
exit(0);
case 'P':
- err = parse_param(optarg);
+ err = parse_param(&user_params, optarg);
if (err)
exit(err);
break;
--
1.7.11.7

View File

@ -0,0 +1,93 @@
From 1c3b1d23e0b3f17399ffd4463cafad813b0444d5 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 15:07:36 -0800
Subject: update systemd service files, add iscsi.service for starting
sessions on boot
Signed-off-by: Chris Leech <cleech@redhat.com>
---
etc/systemd/iscsi.service | 19 +++++++++++++++++++
etc/systemd/iscsi_mark_root_nodes | 14 ++++++++++++++
etc/systemd/iscsid.service | 7 +++++--
etc/systemd/iscsid.socket | 2 +-
4 files changed, 39 insertions(+), 3 deletions(-)
create mode 100644 etc/systemd/iscsi.service
create mode 100755 etc/systemd/iscsi_mark_root_nodes
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
new file mode 100644
index 0000000..bbd52fd
--- /dev/null
+++ b/etc/systemd/iscsi.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Login and scanning of iSCSI devices
+Documentation=man:iscsid(8) man:iscsiadm(8)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
+Before=remote-fs-pre.target
+ConditionPathExists=/etc/iscsi/initiatorname.iscsi
+
+[Service]
+Type=oneshot
+RemainAfterExit=true
+ExecStart=/usr/libexec/iscsi_mark_root_nodes
+ExecStart=/sbin/iscsiadm -m node --loginall=automatic
+ExecStop=/bin/sync
+ExecStop=/sbin/iscsiadm -m node --logoutall=automatic
+
+[Install]
+WantedBy=sysinit.target
diff --git a/etc/systemd/iscsi_mark_root_nodes b/etc/systemd/iscsi_mark_root_nodes
new file mode 100755
index 0000000..c68475c
--- /dev/null
+++ b/etc/systemd/iscsi_mark_root_nodes
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+ISCSIADM=/sbin/iscsiadm
+SESSION_FILE=/run/initramfs/iscsi.sessions
+
+if [ ! -f $SESSION_FILE ] ; then
+ exit 0
+fi
+
+while read t num i target; do
+ ip=${i%:*}
+ $ISCSIADM -m node -p $ip -T $target -o update -n node.startup -v onboot
+done < $SESSION_FILE
+
diff --git a/etc/systemd/iscsid.service b/etc/systemd/iscsid.service
index 028e0b3..653dd08 100644
--- a/etc/systemd/iscsid.service
+++ b/etc/systemd/iscsid.service
@@ -1,7 +1,10 @@
[Unit]
Description=Open-iSCSI
-Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
-After=network.target NetworkManager-wait-online.service iscsiuio.service tgtd.service targetcli.service
+Documentation=man:iscsid(8) man:iscsiadm(8)
+DefaultDependencies=no
+Conflicts=shutdown.target
+After=network.target iscsiuio.service
+Before=remote-fs-pre.target
[Service]
Type=forking
diff --git a/etc/systemd/iscsid.socket b/etc/systemd/iscsid.socket
index 832451d..58a8d12 100644
--- a/etc/systemd/iscsid.socket
+++ b/etc/systemd/iscsid.socket
@@ -1,6 +1,6 @@
[Unit]
Description=Open-iSCSI iscsid Socket
-Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
+Documentation=man:iscsid(8) man:iscsiadm(8)
[Socket]
ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE
--
1.7.11.7

View File

@ -1,6 +1,52 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/etc/iscsid.conf open-iscsi-2.0-872-rc4-bnx2i.build/etc/iscsid.conf
--- open-iscsi-2.0-872-rc4-bnx2i.base/etc/iscsid.conf 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/etc/iscsid.conf 2011-08-14 16:37:47.000000000 -0500
From c255c2cd43afeaefa428237a3200f02fb238d89e Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:37:13 -0800
Subject: update initscripts and docs
---
README | 9 +++------
etc/iscsid.conf | 23 +++++++++++------------
usr/idbm.c | 4 ++++
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/README b/README
index ec22098..2a8319a 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's iSCSI modules will be used. Running:
make
@@ -997,7 +992,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:
@@ -1205,6 +1200,8 @@ iscsid will only perform rediscovery when it gets a SCN from the server.
# 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:
--------
diff --git a/etc/iscsid.conf b/etc/iscsid.conf
index ef76dc0..ac1d231 100644
--- a/etc/iscsid.conf
+++ b/etc/iscsid.conf
@@ -17,10 +17,10 @@
# maintainers.
#
@ -25,7 +71,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/etc/iscsid.conf open-iscsi-2.0-872-
# For "automatic" startup nodes, setting this to "Yes" will try logins on each
# available iface until one succeeds, and then stop. The default "No" will try
@@ -259,28 +259,27 @@ node.conn[0].iscsi.MaxXmitDataSegmentLen
@@ -259,28 +259,27 @@ node.conn[0].iscsi.MaxXmitDataSegmentLength = 0
discovery.sendtargets.iscsi.MaxRecvDataSegmentLength = 32768
# To allow the targets to control the setting of the digest checking,
@ -61,43 +107,11 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/etc/iscsid.conf open-iscsi-2.0-872-
# For multipath configurations, you may want more than one session to be
# created on each iface record. If node.session.nr_sessions is greater
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i.build/README
--- open-iscsi-2.0-872-rc4-bnx2i.base/README 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/README 2011-08-14 16:34:12.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
@@ -975,7 +970,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:
@@ -1183,6 +1178,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:
--------
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c 2011-08-14 16:34:12.000000000 -0500
@@ -373,9 +373,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo
diff --git a/usr/idbm.c b/usr/idbm.c
index 4d30aa9..a1d7d37 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -399,9 +399,13 @@ idbm_recinfo_node(node_rec_t *r, recinfo_t *ri)
IDBM_SHOW, "None", "CRC32C", "CRC32C,None",
"None,CRC32C", num, 1);
sprintf(key, CONN_DATA_DIGEST, i);
@ -111,3 +125,6 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-b
sprintf(key, CONN_IFMARKER, i);
__recinfo_int_o2(key, ri, r, conn[i].iscsi.IFMarker, IDBM_SHOW,
"No", "Yes", num, 1);
--
1.7.11.7

View File

@ -1,55 +1,31 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/doc/iscsiadm.8 open-iscsi-2.0-872-rc4-bnx2i.build/doc/iscsiadm.8
--- open-iscsi-2.0-872-rc4-bnx2i.base/doc/iscsiadm.8 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/doc/iscsiadm.8 2011-08-14 16:41:07.000000000 -0500
@@ -57,7 +57,7 @@ MAC address of a scsi host.
.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
@@ -134,7 +134,7 @@ If no other options are specified: for \
of their respective records are displayed; for \fIsession\fR, all active
sessions and connections are displayed; for \fIfw\fR, all boot firmware
values are displayed; for \fIhost\fR, all iSCSI hosts are displayed; and
-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.
From aaf2b26eae472e5fd596f9bd23f9bf5886b1eb98 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:38:45 -0800
Subject: use var for config
---
README | 33 ++++++++++++++++-----------------
doc/iscsiadm.8 | 8 ++++----
usr/idbm.c | 6 +++---
usr/idbm.h | 15 +++++++++------
usr/iface.h | 4 +++-
5 files changed, 35 insertions(+), 31 deletions(-)
diff --git a/README b/README
index 2a8319a..e5ae2c1 100644
--- a/README
+++ b/README
@@ -156,8 +156,7 @@ Usage: iscsid [OPTION]
.TP
\fB\-n\fR, \fB\-\-name=\fIname\fR
@@ -503,10 +503,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.
Open-iSCSI persistent configuration is stored in a number of
directories under a configuration root directory, using a flat-file
-format. This configuration root directory is /etc/iscsi by default,
-but may also commonly be in /var/lib/iscsi.
+format. This configuration root directory is /var/lib/iscsi by default.
.SH "SEE ALSO"
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i.build/README
--- open-iscsi-2.0-872-rc4-bnx2i.base/README 2011-08-14 16:41:23.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/README 2011-08-14 16:42:47.000000000 -0500
@@ -144,10 +144,10 @@ available on all Linux installations.
Configuration is contained in directories for:
The database contains two tables:
-- Discovery table (/etc/iscsi/send_targets);
-- Node table (/etc/iscsi/nodes).
+- Discovery table (/var/lib/iscsi/send_targets);
+- Node table (/var/lib/iscsi/nodes).
-The regular place for iSCSI database files: /etc/iscsi/nodes
+The regular place for iSCSI database files: /var/lib/iscsi/nodes
The iscsiadm utility is a command-line tool to manage (update, delete,
insert, query) the persistent database.
@@ -422,7 +422,7 @@ a scsi_host per HBA port).
@@ -444,7 +443,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
@ -58,7 +34,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
Prep:
@@ -456,29 +456,29 @@ Running:
@@ -478,29 +477,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
@ -93,7 +69,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
iface.transport_name = tcp
iface.hwaddress = 00:C0:DD:08:63:E7
@@ -528,7 +528,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43
@@ -550,7 +549,7 @@ cxgb3i.00:07:43:05:97:07 cxgb3i,00:07:43:05:97:07,<empty>,<empty>,<empty>
qla4xxx.00:0e:1e:04:8b:2e qla4xxx,00:0e:1e:04:8b:2e,<empty>,<empty>,<empty>
@ -102,7 +78,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
The format is:
iface_name transport_name,hwaddress,ipaddress,net_ifacename,initiatorname
@@ -614,7 +614,7 @@ need a seperate network connection to th
@@ -636,7 +635,7 @@ need a seperate network connection to the target for discovery purposes.
*This will be fixed in the next version of open-iscsi*
For compatibility reasons, when you run iscsiadm to do discovery, it
@ -111,7 +87,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
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
@@ -632,7 +632,7 @@ we do not bind a session to a iface, the
@@ -654,7 +653,7 @@ we do not bind a session to a iface, then you can use the special iface
iscsiadm -m discoverydb -t st -p ip:port -I default --discover -P 1
@ -120,7 +96,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
not pass anything into iscsiadm, running iscsiadm will do the default
behavior, where we allow the network subsystem to decide which
device to use.
@@ -674,7 +674,7 @@ To now log into targets it is the same a
@@ -696,7 +695,7 @@ To now log into targets it is the same as with sofware iscsi. See section
./iscsiadm -m discoverydb -t st -p 192.168.1.1:3260 --discover
@ -129,7 +105,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
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
@@ -683,7 +683,7 @@ To now log into targets it is the same a
@@ -705,7 +704,7 @@ To now log into targets it is the same as with sofware iscsi. See section
The argument to -p may also be a hostname instead of an address.
./iscsiadm -m discoverydb -t st -p smoehost --discover
@ -138,7 +114,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
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
@@ -739,7 +739,7 @@ To now log into targets it is the same a
@@ -761,7 +760,7 @@ To now log into targets it is the same as with sofware iscsi. See section
This command will perform discovery, but not manipulate the node DB.
- SendTargets iSCSI Discovery with a specific interface. If you
@ -147,7 +123,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
then you can pass them in during discovery:
./iscsiadm -m discoverydb -t sendtargets -p 192.168.1.1:3260 \
@@ -1050,8 +1050,8 @@ where targetname is the name of the targ
@@ -1072,8 +1071,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
the portal, and is not used in iscsiadm commands except for static
record creation. And iface name is the name of the iscsi interface
@ -158,7 +134,7 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
Default here is iscsi_tcp/tcp to be used over which ever NIC the
network layer decides is best.
@@ -1166,7 +1166,7 @@ If set, iscsid will perform discovery to
@@ -1188,7 +1187,7 @@ If set, iscsid will perform discovery to the address every
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
@ -167,10 +143,46 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/README open-iscsi-2.0-872-rc4-bnx2i
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.
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c 2011-08-14 16:41:23.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.c 2011-08-14 16:41:07.000000000 -0500
@@ -2359,9 +2359,9 @@ free_info:
diff --git a/doc/iscsiadm.8 b/doc/iscsiadm.8
index 7c209f6..e94cca0 100644
--- a/doc/iscsiadm.8
+++ b/doc/iscsiadm.8
@@ -89,7 +89,7 @@ This option is only valid for ping submode.
.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
@@ -166,7 +166,7 @@ If no other options are specified: for \fIdiscoverydb\fR and \fInode\fR, all
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
@@ -535,10 +535,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 a1d7d37..806d90e 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -2472,9 +2472,9 @@ free_info:
int idbm_init(idbm_get_config_file_fn *fn)
{
/* make sure root db dir is there */
@ -183,12 +195,13 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-b
errno);
return errno;
}
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/idbm.h 2011-08-14 16:41:07.000000000 -0500
@@ -27,12 +27,15 @@
#include "initiator.h"
diff --git a/usr/idbm.h b/usr/idbm.h
index 245f046..5d81df7 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -28,12 +28,15 @@
#include "config.h"
#include "list.h"
-#define NODE_CONFIG_DIR ISCSI_CONFIG_ROOT"nodes"
-#define SLP_CONFIG_DIR ISCSI_CONFIG_ROOT"slp"
@ -208,9 +221,10 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h open-iscsi-2.0-872-rc4-b
#define ST_CONFIG_NAME "st_config"
#define ISNS_CONFIG_NAME "isns_config"
diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/iface.h open-iscsi-2.0-872-rc4-bnx2i.build/usr/iface.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/iface.h 2011-08-14 16:33:53.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/iface.h 2011-08-14 16:41:07.000000000 -0500
diff --git a/usr/iface.h b/usr/iface.h
index 01f7074..f396918 100644
--- a/usr/iface.h
+++ b/usr/iface.h
@@ -20,7 +20,9 @@
#ifndef ISCSI_IFACE_H
#define ISCSI_IFACE_H
@ -222,3 +236,6 @@ diff -aurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/iface.h open-iscsi-2.0-872-rc4-
struct iface_rec;
struct list_head;
--
1.7.11.7

View File

@ -0,0 +1,25 @@
From bf7f9118ab2f1a5302dafa198d3351f6f977b7bd Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:40:04 -0800
Subject: use red hat for name
---
utils/iscsi-iname.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c
index 6347edc..cb2f6c8 100644
--- a/utils/iscsi-iname.c
+++ b/utils/iscsi-iname.c
@@ -73,7 +73,7 @@ main(int argc, char *argv[])
exit(0);
}
} else {
- prefix = "iqn.2005-03.org.open-iscsi";
+ prefix = "iqn.1994-05.com.redhat";
}
/* try to feed some entropy from the pool to MD5 in order to get
--
1.7.11.7

View File

@ -1,7 +1,140 @@
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.c 2012-03-05 23:15:31.000000000 -0600
@@ -0,0 +1,612 @@
From ce1f29f2049320af18eeffd3aefccf840c442ce0 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 16:43:15 -0800
Subject: add libiscsi
---
Makefile | 2 +
libiscsi/Makefile | 61 ++
libiscsi/libiscsi.c | 620 +++++++++++
libiscsi/libiscsi.doxy | 1473 +++++++++++++++++++++++++++
libiscsi/libiscsi.h | 344 +++++++
libiscsi/pylibiscsi.c | 638 ++++++++++++
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/Makefile | 2 +-
usr/discovery.c | 5 +
usr/idbm.c | 6 +-
usr/idbm.h | 3 +
usr/iscsi_ipc.h | 2 +
21 files changed, 3691 insertions(+), 4 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
index c5d9700..6dfbde3 100644
--- a/Makefile
+++ b/Makefile
@@ -32,6 +32,7 @@ user: utils/open-isns/Makefile
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
$(MAKE) -C utils
+ $(MAKE) -C libiscsi
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@@ -56,6 +57,7 @@ kernel: force
force: ;
clean:
+ $(MAKE) -C libiscsi clean
$(MAKE) -C utils/sysdeps clean
$(MAKE) -C utils/fwparam_ibft clean
$(MAKE) -C utils clean
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
new file mode 100644
index 0000000..317a7ec
--- /dev/null
+++ b/libiscsi/Makefile
@@ -0,0 +1,61 @@
+# This Makefile will work only with GNU make.
+
+OSNAME=$(shell uname -s)
+OPTFLAGS ?= -O2 -g
+WARNFLAGS ?= -Wall -Wstrict-prototypes
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
+LIB = libiscsi.so.0
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
+TESTS += tests/test_login tests/test_logout tests/test_params
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
+TESTS += tests/test_set_auth tests/test_get_auth
+
+COMMON_SRCS = sysdeps.o
+# sources shared between iscsid, iscsiadm and iscsistart
+ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o iser.o uip_mgmt_ipc.o
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
+
+# sources shared with the userspace utils, note we build these separately
+# to get PIC versions.
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
+
+# Flags for the tests
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
+
+all: lib tests html
+
+lib: $(LIB)
+tests: $(TESTS)
+
+common-objs/%.o: ../utils/sysdeps/%.c
+ mkdir -p common-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+usr-objs/%.o: ../usr/%.c
+ mkdir -p usr-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
+ mkdir -p fw-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@
+ ln -s -f $(LIB) libiscsi.so
+
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
+
+html: libiscsi.h libiscsi.doxy
+ doxygen libiscsi.doxy
+
+clean:
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
+ .depend *~ html $(TESTS) tests/*~
+
+depend:
+ gcc $(CFLAGS) -M `ls *.c` > .depend
+
+-include .depend ../usr/.depend
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
new file mode 100644
index 0000000..2a176e8
--- /dev/null
+++ b/libiscsi/libiscsi.c
@@ -0,0 +1,620 @@
+/*
+ * iSCSI Administration library
+ *
@ -478,18 +611,26 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c open-iscsi-2.0
+ const char *parameter, const char *value)
+{
+ int nr_found = 0, rc;
+ struct db_set_param set_param = {
+ .name = (char *)parameter,
+ .value = (char *)value,
+ };
+ struct user_param *param;
+ struct list_head params;
+
+ CHECK(idbm_for_each_iface(&nr_found, &set_param, idbm_node_set_param,
+ INIT_LIST_HEAD(&params);
+ param = idbm_alloc_user_param(parameter, value);
+ if (!param) {
+ rc = ENOMEM;
+ goto leave;
+ }
+ list_add_tail(&params, &param->list);
+
+ CHECK(idbm_for_each_iface(&nr_found, &params, idbm_node_set_param,
+ (char *)node->name, node->tpgt,
+ (char *)node->address, node->port))
+ if (nr_found == 0) {
+ strcpy(context->error_str, "No such node");
+ rc = ENODEV;
+ }
+ free(param->name);
+ free(param);
+leave:
+ return rc;
+}
@ -614,9 +755,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.c open-iscsi-2.0
+
+ return 0;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.doxy open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.doxy 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.doxy 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/libiscsi.doxy b/libiscsi/libiscsi.doxy
new file mode 100644
index 0000000..663770f
--- /dev/null
+++ b/libiscsi/libiscsi.doxy
@@ -0,0 +1,1473 @@
+# Doxyfile 1.5.7.1
+
@ -2091,9 +2234,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.doxy open-iscsi-
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.h open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.h 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/libiscsi.h 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h
new file mode 100644
index 0000000..756590e
--- /dev/null
+++ b/libiscsi/libiscsi.h
@@ -0,0 +1,344 @@
+/*
+ * iSCSI Administration library
@ -2439,74 +2584,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/libiscsi.h open-iscsi-2.0
+#endif /* __cplusplus */
+
+#endif
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/Makefile 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2012-03-05 23:16:31.000000000 -0600
@@ -0,0 +1,61 @@
+# This Makefile will work only with GNU make.
+
+OSNAME=$(shell uname -s)
+OPTFLAGS ?= -O2 -g
+WARNFLAGS ?= -Wall -Wstrict-prototypes
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
+LIB = libiscsi.so.0
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
+TESTS += tests/test_login tests/test_logout tests/test_params
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
+TESTS += tests/test_set_auth tests/test_get_auth
+
+COMMON_SRCS = sysdeps.o
+# sources shared between iscsid, iscsiadm and iscsistart
+ISCSI_LIB_SRCS = netlink.o transport.o iser.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o dcb_app.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
+
+# sources shared with the userspace utils, note we build these separately
+# to get PIC versions.
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
+
+# Flags for the tests
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
+
+all: lib tests html
+
+lib: $(LIB)
+tests: $(TESTS)
+
+common-objs/%.o: ../utils/sysdeps/%.c
+ mkdir -p common-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+usr-objs/%.o: ../usr/%.c
+ mkdir -p usr-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
+ mkdir -p fw-objs
+ $(CC) $(CFLAGS) -c $< -o $@
+
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@
+ ln -s -f $(LIB) libiscsi.so
+
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
+
+html: libiscsi.h libiscsi.doxy
+ doxygen libiscsi.doxy
+
+clean:
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
+ .depend *~ html $(TESTS) tests/*~
+
+depend:
+ gcc $(CFLAGS) -M `ls *.c` > .depend
+
+-include .depend ../usr/.depend
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/pylibiscsi.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/pylibiscsi.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/pylibiscsi.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/pylibiscsi.c b/libiscsi/pylibiscsi.c
new file mode 100644
index 0000000..4b09aa7
--- /dev/null
+++ b/libiscsi/pylibiscsi.c
@@ -0,0 +1,638 @@
+/*
+ * iSCSI Administration library
@ -3146,9 +3228,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/pylibiscsi.c open-iscsi-2
+ Py_INCREF(&PyIscsiNode_Type);
+ PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type);
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/setup.py open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/setup.py 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/setup.py 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/setup.py b/libiscsi/setup.py
new file mode 100644
index 0000000..bb4329b
--- /dev/null
+++ b/libiscsi/setup.py
@@ -0,0 +1,9 @@
+from distutils.core import setup, Extension
+
@ -3159,9 +3243,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/setup.py open-iscsi-2.0-8
+
+setup (name = 'PyIscsi',version = '1.0',
+ description = 'libiscsi python bindings', ext_modules = [module1])
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_firmware.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_firmware.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_firmware.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_discovery_firmware.c b/libiscsi/tests/test_discovery_firmware.c
new file mode 100644
index 0000000..76e852a
--- /dev/null
+++ b/libiscsi/tests/test_discovery_firmware.c
@@ -0,0 +1,53 @@
+/*
+ * iSCSI Administration library
@ -3216,9 +3302,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_firm
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_sendtargets.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_sendtargets.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_discovery_sendtargets.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_discovery_sendtargets.c b/libiscsi/tests/test_discovery_sendtargets.c
new file mode 100644
index 0000000..1a3c12e
--- /dev/null
+++ b/libiscsi/tests/test_discovery_sendtargets.c
@@ -0,0 +1,60 @@
+/*
+ * iSCSI Administration library
@ -3280,9 +3368,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_discovery_send
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_auth.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_auth.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_get_auth.c b/libiscsi/tests/test_get_auth.c
new file mode 100644
index 0000000..5e234da
--- /dev/null
+++ b/libiscsi/tests/test_get_auth.c
@@ -0,0 +1,70 @@
+/*
+ * iSCSI Administration library
@ -3354,9 +3444,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_auth.c ope
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_initiator_name.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_initiator_name.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_initiator_name.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_get_initiator_name.c b/libiscsi/tests/test_get_initiator_name.c
new file mode 100644
index 0000000..997c053
--- /dev/null
+++ b/libiscsi/tests/test_get_initiator_name.c
@@ -0,0 +1,38 @@
+/*
+ * iSCSI Administration library
@ -3396,9 +3488,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_initiator_
+
+ return 0;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_network_config.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_network_config.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_get_network_config.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_get_network_config.c b/libiscsi/tests/test_get_network_config.c
new file mode 100644
index 0000000..2dedd61
--- /dev/null
+++ b/libiscsi/tests/test_get_network_config.c
@@ -0,0 +1,45 @@
+/*
+ * iSCSI Administration library
@ -3445,9 +3539,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_get_network_co
+
+ return 0;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_login.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_login.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_login.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_login.c b/libiscsi/tests/test_login.c
new file mode 100644
index 0000000..3eb70d6
--- /dev/null
+++ b/libiscsi/tests/test_login.c
@@ -0,0 +1,52 @@
+/*
+ * iSCSI Administration library
@ -3501,9 +3597,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_login.c open-i
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_logout.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_logout.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_logout.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_logout.c b/libiscsi/tests/test_logout.c
new file mode 100644
index 0000000..b734dca
--- /dev/null
+++ b/libiscsi/tests/test_logout.c
@@ -0,0 +1,51 @@
+/*
+ * iSCSI Administration library
@ -3556,9 +3654,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_logout.c open-
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_params.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_params.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_params.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_params.c b/libiscsi/tests/test_params.c
new file mode 100644
index 0000000..d3223be
--- /dev/null
+++ b/libiscsi/tests/test_params.c
@@ -0,0 +1,103 @@
+/*
+ * iSCSI Administration library
@ -3663,9 +3763,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_params.c open-
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_set_auth.c open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_set_auth.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/tests/test_set_auth.c 2012-03-05 23:15:31.000000000 -0600
diff --git a/libiscsi/tests/test_set_auth.c b/libiscsi/tests/test_set_auth.c
new file mode 100644
index 0000000..a21f888
--- /dev/null
+++ b/libiscsi/tests/test_set_auth.c
@@ -0,0 +1,58 @@
+/*
+ * iSCSI Administration library
@ -3725,28 +3827,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/libiscsi/tests/test_set_auth.c ope
+
+ return rc;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i.base/Makefile 2012-03-05 23:19:56.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/Makefile 2012-03-05 23:15:31.000000000 -0600
@@ -32,6 +32,7 @@ user: utils/open-isns/Makefile
$(MAKE) -C utils/fwparam_ibft
$(MAKE) -C usr
$(MAKE) -C utils
+ $(MAKE) -C libiscsi
@echo
@echo "Compilation complete Output file"
@echo "----------------------------------- ----------------"
@@ -56,6 +57,7 @@ kernel: force
force: ;
diff --git a/usr/Makefile b/usr/Makefile
index 1506111..015f1b9 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
clean:
+ $(MAKE) -C libiscsi clean
$(MAKE) -C utils/sysdeps clean
$(MAKE) -C utils/fwparam_ibft clean
$(MAKE) -C utils clean
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/discovery.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/discovery.c 2012-03-05 23:19:56.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/discovery.c 2012-03-05 23:15:31.000000000 -0600
# libc compat files
diff --git a/usr/discovery.c b/usr/discovery.c
index afce6c0..0c93749 100644
--- a/usr/discovery.c
+++ b/usr/discovery.c
@@ -36,6 +36,7 @@
#include "types.h"
#include "iscsi_proto.h"
@ -3783,10 +3880,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/discovery.c open-iscsi-2.0-872
int discovery_fw(void *data, struct iface_rec *iface,
struct list_head *rec_list)
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c 2012-03-05 23:20:05.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.c 2012-03-05 23:15:31.000000000 -0600
@@ -1300,9 +1300,9 @@ int idbm_print_all_discovery(int info_le
diff --git a/usr/idbm.c b/usr/idbm.c
index 806d90e..c20f7d9 100644
--- a/usr/idbm.c
+++ b/usr/idbm.c
@@ -1335,9 +1335,9 @@ int idbm_print_all_discovery(int info_level)
* fn should return -1 if it skipped the rec, a ISCSI_ERR error code if
* the operation failed or 0 if fn was run successfully.
*/
@ -3799,10 +3897,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.c open-iscsi-2.0-872-rc4-
{
DIR *iface_dirfd;
struct dirent *iface_dent;
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h 2012-03-05 23:20:05.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/idbm.h 2012-03-05 23:15:31.000000000 -0600
@@ -98,6 +98,9 @@ struct rec_op_data {
diff --git a/usr/idbm.h b/usr/idbm.h
index 5d81df7..f645561 100644
--- a/usr/idbm.h
+++ b/usr/idbm.h
@@ -101,6 +101,9 @@ struct rec_op_data {
node_rec_t *match_rec;
idbm_iface_op_fn *fn;
};
@ -3812,25 +3911,17 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/idbm.h open-iscsi-2.0-872-rc4-
extern int idbm_for_each_portal(int *found, void *data,
idbm_portal_op_fn *fn, char *targetname);
extern int idbm_for_each_node(int *found, void *data,
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/iscsi_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/iscsi_ipc.h 2012-03-05 23:19:56.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_ipc.h 2012-03-05 23:15:31.000000000 -0600
@@ -136,4 +136,6 @@ struct iscsi_ipc {
int (*recv_conn_state) (struct iscsi_conn *conn, uint32_t *state);
diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h
index db5f1f0..e0bf051 100644
--- a/usr/iscsi_ipc.h
+++ b/usr/iscsi_ipc.h
@@ -147,4 +147,6 @@ struct iscsi_ipc {
uint16_t chap_tbl_idx);
};
+struct iscsi_ipc *ipc;
+
#endif /* ISCSI_IPC_H */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i.base/usr/Makefile 2012-03-05 23:19:56.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2012-03-05 23:15:31.000000000 -0600
@@ -33,7 +33,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
--
1.7.11.7

View File

@ -0,0 +1,25 @@
From ff224a16d409c4b479b3ac1ff662093cb067e281 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 17:04:29 -0800
Subject: dont use static
---
usr/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/Makefile b/usr/Makefile
index 015f1b9..1669890 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
iscsistart.o statics.o
- $(CC) $(CFLAGS) -static $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@
clean:
rm -f *.o $(PROGRAMS) .depend $(LIBSYS)
--
1.7.11.7

View File

@ -0,0 +1,45 @@
From aa58a042ec20575143c1a5c813c9552a286aeb0e Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 19 Nov 2012 17:09:24 -0800
Subject: remove the offload boot supported ifdef
---
usr/iface.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/usr/iface.c b/usr/iface.c
index c86892e..f5441c0 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -895,6 +895,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
{
struct iscsi_transport *t = NULL;
uint32_t hostno;
+ int rc;
if (strlen(context->initiatorname))
strlcpy(iface->iname, context->initiatorname,
@@ -907,10 +908,7 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
return 0;
}
} else if (strlen(context->iface)) {
-/* this ifdef is only temp until distros and firmwares are updated */
-#ifdef OFFLOAD_BOOT_SUPPORTED
char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
- int rc;
memset(transport_name, 0, ISCSI_TRANSPORT_NAME_MAXLEN);
/* make sure offload driver is loaded */
@@ -936,9 +934,6 @@ int iface_setup_from_boot_context(struct iface_rec *iface,
}
strlcpy(iface->netdev, context->iface, sizeof(iface->netdev));
-#else
- return 0;
-#endif
} else
return 0;
--
1.7.11.7

View File

@ -1,30 +1,56 @@
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h
--- open-iscsi-2.0-872-rc4-bnx2i/include/iscsi_err.h 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/include/iscsi_err.h 2012-03-05 23:36:29.000000000 -0600
@@ -58,6 +58,8 @@ enum {
ISCSI_ERR_ISNS_QUERY = 25,
/* iSNS registration/deregistration failed */
ISCSI_ERR_ISNS_REG_FAILED = 26,
From 59b5b828b2a763f47fb205aedf202990d64e748c Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 24 Dec 2012 13:37:53 -0800
Subject: iscsid iscsiuio ipc interface
---
include/iscsi_err.h | 2 +
usr/Makefile | 3 +-
usr/initiator.c | 113 ++++++++++++++++++++++++++++++++++++++++++++++++-
usr/initiator.h | 4 ++
usr/initiator_common.c | 34 +++++++++++++++
usr/iscsi_err.c | 1 +
usr/iscsid_req.c | 91 +++++++++++++++++++++++++++++++++++++--
usr/iscsid_req.h | 2 +
usr/transport.c | 2 +
usr/transport.h | 3 ++
usr/uip_mgmt_ipc.c | 41 ++++++++++++++++++
usr/uip_mgmt_ipc.h | 73 ++++++++++++++++++++++++++++++++
12 files changed, 364 insertions(+), 5 deletions(-)
create mode 100644 usr/uip_mgmt_ipc.c
create mode 100644 usr/uip_mgmt_ipc.h
diff --git a/include/iscsi_err.h b/include/iscsi_err.h
index aabea4e..1139133 100644
--- a/include/iscsi_err.h
+++ b/include/iscsi_err.h
@@ -62,6 +62,8 @@ enum {
ISCSI_ERR_OP_NOT_SUPP = 27,
/* device or resource in use */
ISCSI_ERR_BUSY = 28,
+ /* Operation failed, but retrying layer may succeed */
+ ISCSI_ERR_AGAIN = 27,
+ ISCSI_ERR_AGAIN = 29,
/* Always last. Indicates end of error code space */
ISCSI_MAX_ERR_VAL,
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/libiscsi/Makefile 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/libiscsi/Makefile 2012-03-05 23:37:25.000000000 -0600
@@ -13,7 +13,7 @@ TESTS += tests/test_set_auth tests/test_
diff --git a/usr/Makefile b/usr/Makefile
index 1669890..5bf5f83 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -40,7 +40,8 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysdeps/*.o)
ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
iscsi_net_util.o iscsid_req.o transport.o iser.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o iscsi_param.o $(IPC_OBJ) $(SYSDEPS_SRCS)
+ initiator_common.o iscsi_err.o iscsi_param.o uip_mgmt_ipc.o \
+ $(IPC_OBJ) $(SYSDEPS_SRCS)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o
COMMON_SRCS = sysdeps.o
# sources shared between iscsid, iscsiadm and iscsistart
-ISCSI_LIB_SRCS = netlink.o transport.o iser.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o dcb_app.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
+ISCSI_LIB_SRCS = netlink.o uip_mgmt_ipc.o transport.o iser.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o dcb_app.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o
FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
# sources shared with the userspace utils, note we build these separately
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2012-03-05 23:36:29.000000000 -0600
diff --git a/usr/initiator.c b/usr/initiator.c
index d475358..597e0ff 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -45,6 +45,7 @@
#include "iscsi_sysfs.h"
#include "iscsi_settings.h"
@ -33,7 +59,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
#include "sysdeps.h"
#include "iscsi_err.h"
#include "kern_err_table.h"
@@ -557,6 +558,48 @@ static int iscsi_conn_connect(struct isc
@@ -557,6 +558,48 @@ static int iscsi_conn_connect(struct iscsi_conn *conn, queue_task_t *qtask)
return 0;
}
@ -82,7 +108,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
static void
__session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
int redirected)
@@ -598,6 +641,11 @@ __session_conn_reopen(iscsi_conn_t *conn
@@ -598,6 +641,11 @@ __session_conn_reopen(iscsi_conn_t *conn, queue_task_t *qtask, int do_stop,
if (!redirected)
session->reopen_cnt++;
@ -94,7 +120,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
if (iscsi_conn_connect(conn, qtask)) {
delay = ISCSI_CONN_ERR_REOPEN_DELAY;
goto queue_reopen;
@@ -1667,6 +1715,53 @@ failed_login:
@@ -1670,6 +1718,53 @@ failed_login:
}
@ -148,7 +174,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
struct iscsi_conn *conn, unsigned long tmo,
int event)
@@ -1708,6 +1803,11 @@ static int iscsi_sched_ev_context(struct
@@ -1711,6 +1806,11 @@ static int iscsi_sched_ev_context(struct iscsi_ev_context *ev_context,
ev_context);
actor_schedule(&ev_context->actor);
break;
@ -160,7 +186,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
case EV_CONN_LOGOUT_TIMER:
actor_timer(&ev_context->actor, tmo * 1000,
iscsi_logout_timedout, ev_context);
@@ -1841,7 +1941,17 @@ session_login_task(node_rec_t *rec, queu
@@ -1844,7 +1944,17 @@ session_login_task(node_rec_t *rec, queue_task_t *qtask)
conn = &session->conn[0];
qtask->conn = conn;
@ -179,7 +205,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
__session_destroy(session);
return ISCSI_ERR_LOGIN;
}
@@ -1998,6 +2108,7 @@ iscsi_host_send_targets(queue_task_t *qt
@@ -2001,6 +2111,7 @@ iscsi_host_send_targets(queue_task_t *qtask, int host_no, int do_login,
struct sockaddr_storage *ss)
{
struct iscsi_transport *t;
@ -187,10 +213,32 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-
t = iscsi_sysfs_get_transport_by_hba(host_no);
if (!t) {
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator_common.c 2012-03-05 23:36:29.000000000 -0600
@@ -561,6 +561,36 @@ TODO handle this
diff --git a/usr/initiator.h b/usr/initiator.h
index b45caab..d6dc02e 100644
--- a/usr/initiator.h
+++ b/usr/initiator.h
@@ -83,6 +83,7 @@ typedef enum iscsi_event_e {
EV_CONN_LOGOUT_TIMER,
EV_CONN_STOP,
EV_CONN_LOGIN,
+ EV_UIO_POLL,
} iscsi_event_e;
struct queue_task;
@@ -353,5 +354,8 @@ extern void iscsi_copy_operational_params(struct iscsi_conn *conn,
extern int iscsi_setup_authentication(struct iscsi_session *session,
struct iscsi_auth_config *auth_cfg);
extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
+extern int iscsi_set_net_config(struct iscsi_transport *t,
+ iscsi_session_t *session,
+ struct iface_rec *iface);
#endif /* INITIATOR_H */
diff --git a/usr/initiator_common.c b/usr/initiator_common.c
index ef6820c..eb72795 100644
--- a/usr/initiator_common.c
+++ b/usr/initiator_common.c
@@ -562,6 +562,36 @@ TODO handle this
return 0;
}
@ -227,9 +275,9 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-8
int iscsi_host_set_net_params(struct iface_rec *iface,
struct iscsi_session *session)
{
@@ -582,6 +612,10 @@ int iscsi_host_set_net_params(struct ifa
return EINVAL;
}
@@ -600,6 +630,10 @@ int iscsi_host_set_net_params(struct iface_rec *iface,
log_warning("Could not brining up netdev %s. Try running "
"'ifup %s' first if login fails.", netdev, netdev);
+ rc = iscsi_set_net_config(t, session, iface);
+ if (rc != 0)
@ -238,29 +286,22 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator_common.c open-iscsi-2.0-8
rc = host_set_param(t, session->hostno,
ISCSI_HOST_PARAM_IPADDRESS,
iface->ipaddress, ISCSI_STRING);
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.h 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.h 2012-03-05 23:36:29.000000000 -0600
@@ -83,6 +83,7 @@ typedef enum iscsi_event_e {
EV_CONN_LOGOUT_TIMER,
EV_CONN_STOP,
EV_CONN_LOGIN,
+ EV_UIO_POLL,
} iscsi_event_e;
diff --git a/usr/iscsi_err.c b/usr/iscsi_err.c
index 4fe1c53..f9ba130 100644
--- a/usr/iscsi_err.c
+++ b/usr/iscsi_err.c
@@ -51,6 +51,7 @@ static char *iscsi_err_msgs[] = {
/* 26 */ "iSNS registration failed",
/* 27 */ "operation not supported",
/* 28 */ "device or resource in use",
+ /* 29 */ "Retryable failure",
};
struct queue_task;
@@ -353,5 +354,8 @@ extern void iscsi_copy_operational_param
extern int iscsi_setup_authentication(struct iscsi_session *session,
struct iscsi_auth_config *auth_cfg);
extern int iscsi_setup_portal(struct iscsi_conn *conn, char *address, int port);
+extern int iscsi_set_net_config(struct iscsi_transport *t,
+ iscsi_session_t *session,
+ struct iface_rec *iface);
#endif /* INITIATOR_H */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.c 2012-03-05 23:36:29.000000000 -0600
char *iscsi_err_to_str(int err)
diff --git a/usr/iscsid_req.c b/usr/iscsid_req.c
index 1c4678d..a436194 100644
--- a/usr/iscsid_req.c
+++ b/usr/iscsid_req.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <string.h>
@ -284,20 +325,23 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
-static int iscsid_connect(int *fd, int start_iscsid)
+static int ipc_connect(int *fd, char *unix_sock_name, int start_iscsid)
{
int nsec;
int nsec, addr_len;
struct sockaddr_un addr;
@@ -67,8 +69,8 @@ static int iscsid_connect(int *fd, int s
@@ -65,11 +67,11 @@ static int iscsid_connect(int *fd, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
- addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(ISCSIADM_NAMESPACE) + 1;
+ addr_len = offsetof(struct sockaddr_un, sun_path) + strlen(unix_sock_name) + 1;
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));
- memcpy((char *) &addr.sun_path + 1, ISCSIADM_NAMESPACE, addr_len);
+ memcpy((char *) &addr.sun_path + 1, unix_sock_name, addr_len);
/*
* Trying to connect with exponential backoff
*/
@@ -96,6 +98,11 @@ static int iscsid_connect(int *fd, int s
@@ -98,6 +100,11 @@ static int iscsid_connect(int *fd, int start_iscsid)
return ISCSI_ERR_ISCSID_NOTCONN;
}
@ -309,7 +353,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
int iscsid_request(int *fd, iscsiadm_req_t *req, int start_iscsid)
{
int err;
@@ -192,3 +199,81 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd
@@ -194,3 +201,81 @@ int iscsid_req_by_sid(iscsiadm_cmd_e cmd, int sid)
return err;
return iscsid_req_wait(cmd, fd);
}
@ -391,44 +435,22 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.c open-iscsi-2.0-872-rc4
+ close(fd);
+ return err;
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsid_req.h 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsid_req.h 2012-03-05 23:36:29.000000000 -0600
@@ -33,4 +33,6 @@ extern int iscsid_req_by_rec(int cmd, st
diff --git a/usr/iscsid_req.h b/usr/iscsid_req.h
index 68f5256..4fff43d 100644
--- a/usr/iscsid_req.h
+++ b/usr/iscsid_req.h
@@ -33,4 +33,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 -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_err.c 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_err.c 2012-03-05 23:36:29.000000000 -0600
@@ -49,6 +49,7 @@ static char *iscsi_err_msgs[] = {
/* 24 */ "iSCSI login failed due to authorization failure",
/* 25 */ "iSNS query failed",
/* 26 */ "iSNS registration failed",
+ /* 27 */ "Retryable failure",
};
char *iscsi_err_to_str(int err)
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2012-03-05 23:38:00.000000000 -0600
@@ -42,7 +42,8 @@ SYSDEPS_SRCS = $(wildcard ../utils/sysde
ISCSI_LIB_SRCS = iscsi_util.o io.o auth.o iscsi_timer.o login.o log.o md5.o \
sha1.o iface.o idbm.o sysfs.o host.o session_info.o iscsi_sysfs.o \
iscsi_net_util.o iscsid_req.o transport.o iser.o cxgbi.o be2iscsi.o \
- initiator_common.o iscsi_err.o $(IPC_OBJ) $(SYSDEPS_SRCS) $(DCB_OBJ)
+ initiator_common.o iscsi_err.o uip_mgmt_ipc.o \
+ $(IPC_OBJ) $(SYSDEPS_SRCS) $(DCB_OBJ)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o event_poll.o mgmt_ipc.o kern_err_table.o
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.c 2012-03-05 23:36:29.000000000 -0600
@@ -25,6 +25,7 @@
diff --git a/usr/transport.c b/usr/transport.c
index e6e3dfc..10212af 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -35,6 +35,7 @@
#include "log.h"
#include "iscsi_util.h"
#include "iscsi_sysfs.h"
@ -436,7 +458,7 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-
#include "cxgbi.h"
#include "be2iscsi.h"
#include "iser.h"
@@ -69,6 +70,7 @@ struct iscsi_transport_template bnx2i =
@@ -79,6 +80,7 @@ struct iscsi_transport_template bnx2i = {
.ep_connect = ktransport_ep_connect,
.ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect,
@ -444,9 +466,10 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.c open-iscsi-2.0-872-rc4-
};
struct iscsi_transport_template be2iscsi = {
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h 2012-03-05 23:36:21.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/transport.h 2012-03-05 23:36:29.000000000 -0600
diff --git a/usr/transport.h b/usr/transport.h
index 672561b..5dcf872 100644
--- a/usr/transport.h
+++ b/usr/transport.h
@@ -35,6 +35,9 @@ struct iscsi_transport_template {
int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms);
void (*ep_disconnect) (struct iscsi_conn *conn);
@ -457,9 +480,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/transport.h open-iscsi-2.0-872-rc4-
};
/* represents data path provider */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.c 2012-03-05 23:36:29.000000000 -0600
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
new file mode 100644
index 0000000..73b1632
--- /dev/null
+++ b/usr/uip_mgmt_ipc.c
@@ -0,0 +1,41 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
@ -502,9 +527,11 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.c open-iscsi-2.0-872-r
+ sizeof(iscsid_uip_broadcast_header_t) +
+ sizeof(*iface));
+}
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/uip_mgmt_ipc.h 2012-03-05 23:36:29.000000000 -0600
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
new file mode 100644
index 0000000..3859688
--- /dev/null
+++ b/usr/uip_mgmt_ipc.h
@@ -0,0 +1,73 @@
+/*
+ * uIP iSCSI Daemon/Admin Management IPC
@ -579,3 +606,6 @@ diff -Naurp open-iscsi-2.0-872-rc4-bnx2i/usr/uip_mgmt_ipc.h open-iscsi-2.0-872-r
+
+
+#endif /* UIP_MGMT_IPC_H */
--
1.7.11.7

View File

@ -0,0 +1,122 @@
From e74f511ba862195d909bba90091fd84bd7904914 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 2 Jan 2013 14:45:05 -0800
Subject: iscsiuio IPC newroot command
---
usr/mgmt_ipc.c | 11 +++++++++++
usr/transport.c | 1 +
usr/transport.h | 1 +
usr/uip_mgmt_ipc.c | 14 ++++++++++++++
usr/uip_mgmt_ipc.h | 5 +++++
5 files changed, 32 insertions(+)
diff --git a/usr/mgmt_ipc.c b/usr/mgmt_ipc.c
index 5cb7143..a8f8473 100644
--- a/usr/mgmt_ipc.c
+++ b/usr/mgmt_ipc.c
@@ -36,6 +36,7 @@
#include "sysdeps.h"
#include "iscsi_ipc.h"
#include "iscsi_err.h"
+#include "iscsi_sysfs.h"
#define PEERUSER_MAX 64
#define EXTMSG_MAX (64 * 1024)
@@ -229,8 +230,18 @@ static int
mgmt_ipc_newroot(queue_task_t *qtask)
{
char *newroot = qtask->req.u.newroot.path;
+ struct iscsi_transport *t;
+
if (chdir(newroot) || chroot(".") || chdir("/"))
return ISCSI_ERR;
+
+ /* if a registered transport has a separate userspace process,
+ * notify it of the root change as well */
+ list_for_each_entry(t, &transports, list) {
+ if (t->template->newroot)
+ t->template->newroot(t, newroot);
+ }
+
mgmt_ipc_write_rsp(qtask, ISCSI_SUCCESS);
return ISCSI_SUCCESS;
}
diff --git a/usr/transport.c b/usr/transport.c
index 10212af..02ad717 100644
--- a/usr/transport.c
+++ b/usr/transport.c
@@ -81,6 +81,7 @@ struct iscsi_transport_template bnx2i = {
.ep_poll = ktransport_ep_poll,
.ep_disconnect = ktransport_ep_disconnect,
.set_net_config = uip_broadcast_params,
+ .newroot = uip_broadcast_newroot,
};
struct iscsi_transport_template be2iscsi = {
diff --git a/usr/transport.h b/usr/transport.h
index 5dcf872..eb3a946 100644
--- a/usr/transport.h
+++ b/usr/transport.h
@@ -38,6 +38,7 @@ struct iscsi_transport_template {
int (*set_net_config) (struct iscsi_transport *t,
struct iface_rec *iface,
struct iscsi_session *session);
+ void (*newroot) (struct iscsi_transport *t, char *path);
};
/* represents data path provider */
diff --git a/usr/uip_mgmt_ipc.c b/usr/uip_mgmt_ipc.c
index 73b1632..9fa5398 100644
--- a/usr/uip_mgmt_ipc.c
+++ b/usr/uip_mgmt_ipc.c
@@ -39,3 +39,17 @@ int uip_broadcast_params(struct iscsi_transport *t,
sizeof(iscsid_uip_broadcast_header_t) +
sizeof(*iface));
}
+
+int uip_broadcast_newroot(struct iscsi_transport *t, char *newroot)
+{
+ struct iscsid_uip_broadcast broadcast;
+
+ memset(&broadcast, 0, sizeof(broadcast));
+
+ broadcast.header.command = ISCSID_UIP_NEWROOT;
+ strncpy(broadcast.u.newroot.path, newroot, PATH_MAX);
+
+ return uip_broadcast(&broadcast,
+ sizeof(iscsid_uip_broadcast_header_t) +
+ PATH_MAX + 1);
+}
diff --git a/usr/uip_mgmt_ipc.h b/usr/uip_mgmt_ipc.h
index 3859688..9de88c2 100644
--- a/usr/uip_mgmt_ipc.h
+++ b/usr/uip_mgmt_ipc.h
@@ -29,6 +29,7 @@
typedef enum iscsid_uip_cmd {
ISCSID_UIP_IPC_UNKNOWN = 0,
ISCSID_UIP_IPC_GET_IFACE = 1,
+ ISCSID_UIP_NEWROOT = 2,
__ISCSID_UIP_IPC_MAX_COMMAND
} iscsid_uip_cmd_e;
@@ -47,6 +48,9 @@ typedef struct iscsid_uip_broadcast {
struct ipc_broadcast_iface_rec {
struct iface_rec rec;
} iface_rec;
+ struct ipc_broadcast_newroot {
+ char path[PATH_MAX + 1];
+ } newroot;
} u;
} iscsid_uip_broadcast_t;
@@ -69,5 +73,6 @@ extern int uip_broadcast_params(struct iscsi_transport *t,
struct iface_rec *iface,
struct iscsi_session *session);
+extern int uip_broadcast_newroot(struct iscsi_transport *t, char *path);
#endif /* UIP_MGMT_IPC_H */
--
1.7.11.7

View File

@ -0,0 +1,53 @@
From 822b53e6c9ebb0fe7236ebd3b4c73b009100592d Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 22 Jan 2013 14:27:12 -0800
Subject: iscsiuio systemd unit files
---
etc/systemd/iscsiuio.service | 17 +++++++++++++++++
etc/systemd/iscsiuio.socket | 9 +++++++++
2 files changed, 26 insertions(+)
create mode 100644 etc/systemd/iscsiuio.service
create mode 100644 etc/systemd/iscsiuio.socket
diff --git a/etc/systemd/iscsiuio.service b/etc/systemd/iscsiuio.service
new file mode 100644
index 0000000..f0410b7
--- /dev/null
+++ b/etc/systemd/iscsiuio.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=iSCSI UserSpace I/O driver
+Documentation=man:iscsiuio(8)
+DefaultDependencies=no
+Conflicts=shutdown.target
+Requires=iscsid.service
+BindTo=iscsid.service
+After=network.target
+Before=remote-fs-pre.target iscsid.service
+
+[Service]
+Type=forking
+PIDFile=/var/run/iscsiuio.pid
+ExecStart=/usr/sbin/iscsiuio
+
+[Install]
+WantedBy=multi-user.target
diff --git a/etc/systemd/iscsiuio.socket b/etc/systemd/iscsiuio.socket
new file mode 100644
index 0000000..d42cedc
--- /dev/null
+++ b/etc/systemd/iscsiuio.socket
@@ -0,0 +1,9 @@
+[Unit]
+Description=Open-iSCSI iscsiuio Socket
+Documentation=man:iscsiuio(8)
+
+[Socket]
+ListenStream=@ISCSID_UIP_ABSTRACT_NAMESPACE
+
+[Install]
+WantedBy=sockets.target
--
1.7.11.7

View File

@ -0,0 +1,25 @@
From c3d2b8f3de5b6161845304cf46982d2c5a9918b6 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Thu Feb 21 21:05:39 PST 2013
Subject: disable iscsid.startup from iscsiadm, prefer systemd socket activation
---
etc/iscsid.conf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/iscsid.conf b/etc/iscsid.conf
index ac1d231..5851fa5 100644
--- a/etc/iscsid.conf
+++ b/etc/iscsid.conf
@@ -17,7 +17,7 @@
# maintainers.
#
# Default for Fedora and RHEL. (uncomment to activate).
-iscsid.startup = /etc/rc.d/init.d/iscsid force-start
+#iscsid.startup = /bin/systemctl start iscsid.service
#
# Default for upstream open-iscsi scripts (uncomment to activate).
# iscsid.startup = /sbin/iscsid
--
1.7.11.7

View File

@ -0,0 +1,39 @@
From bc4cf1487b4d6039de2a082c1786ac83ab148c88 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 22 Jan 2013 15:14:21 -0800
Subject: resolve 565245: multilib issues caused by doxygen
---
libiscsi/libiscsi.doxy | 2 +-
libiscsi/no_date_footer.html | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
create mode 100644 libiscsi/no_date_footer.html
diff --git a/libiscsi/libiscsi.doxy b/libiscsi/libiscsi.doxy
index 663770f..7a5ff7f 100644
--- a/libiscsi/libiscsi.doxy
+++ b/libiscsi/libiscsi.doxy
@@ -765,7 +765,7 @@ HTML_HEADER =
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
-HTML_FOOTER =
+HTML_FOOTER = no_date_footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to
diff --git a/libiscsi/no_date_footer.html b/libiscsi/no_date_footer.html
new file mode 100644
index 0000000..1e0c6c4
--- /dev/null
+++ b/libiscsi/no_date_footer.html
@@ -0,0 +1,6 @@
+<hr size="1"><address style="text-align: right;"><small>
+Generated for $projectname by <a href="http://www.doxygen.org/
+index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a>
+$doxygenversion</small></address>
+</body>
+</html>
--
1.7.11.7

View File

@ -0,0 +1,30 @@
From ab79bdb20e37216ca969e06d63a952acfd023963 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 28 May 2013 13:12:27 -0700
Subject: [PATCH] Don't check for autostart sessions if iscsi is not used (bug
#951951)
Change conditional startup in iscsi.service to check for a non-empty
nodes directory, instead of initiator-name. This fits better with what
it's doing, as there's no need to scan for autostart node records if
there are no node records at all.
---
etc/systemd/iscsi.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/etc/systemd/iscsi.service b/etc/systemd/iscsi.service
index bbd52fd..7b4efee 100644
--- a/etc/systemd/iscsi.service
+++ b/etc/systemd/iscsi.service
@@ -5,7 +5,7 @@ DefaultDependencies=no
Conflicts=shutdown.target
After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service
Before=remote-fs-pre.target
-ConditionPathExists=/etc/iscsi/initiatorname.iscsi
+ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes
[Service]
Type=oneshot
--
1.8.1.4

View File

@ -0,0 +1,68 @@
From 3cac85a3f97d0a22270166f428209f873b58c319 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Tue, 11 Jun 2013 11:25:27 -0700
Subject: [PATCH] iscsid: fix order of setting uid/gid and drop supplementary
groups
If using the user and group ID settings together the existing order of
calling setuid first will almost always cause the setgid call to fail,
assuming the new effective user id does not have the CAP_SETGID
capability. The effective group ID needs to change first.
While we're at it, if iscsid is started as root it should drop any
inherited supplementary group permissions.
And if anyone is actually using this to try and isolate capabilities,
they probably care enough to want to known that it is failing. Make
iscsid startup fail instead of just calling perror.
Signed-off-by: Chris Leech <cleech@redhat.com>
---
usr/iscsid.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/usr/iscsid.c b/usr/iscsid.c
index b4bb65b..c0ea6fa 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -27,6 +27,7 @@
#include <unistd.h>
#include <string.h>
#include <signal.h>
+#include <grp.h>
#include <sys/mman.h>
#include <sys/utsname.h>
#include <sys/types.h>
@@ -477,11 +478,25 @@ int main(int argc, char *argv[])
}
}
- if (uid && setuid(uid) < 0)
- perror("setuid\n");
+ if (gid && setgid(gid) < 0) {
+ log_error("Unable to setgid to %d\n", gid);
+ log_close(log_pid);
+ exit(ISCSI_ERR);
+ }
- if (gid && setgid(gid) < 0)
- perror("setgid\n");
+ if ((geteuid() == 0) && (getgroups(0, NULL))) {
+ if (setgroups(0, NULL) != 0) {
+ log_error("Unable to drop supplementary group ids\n");
+ log_close(log_pid);
+ exit(ISCSI_ERR);
+ }
+ }
+
+ if (uid && setuid(uid) < 0) {
+ log_error("Unable to setuid to %d\n", uid);
+ log_close(log_pid);
+ exit(ISCSI_ERR);
+ }
memset(&daemon_config, 0, sizeof (daemon_config));
daemon_config.pid_file = pid_file;
--
1.8.1.4

View File

@ -1,7 +1,44 @@
diff --git a/iscsiuio/README b/iscsiuio/README
From bd534355001eab5bcb4f2473dd71594b44c97d63 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:27:45 -0800
Subject: iscsiuio 0.7.4.3
---
README | 15 +-
RELEASE.TXT | 228 +++++++++++-
configure | 18 +-
configure.ac | 6 +-
docs/iscsiuio.8 | 4 +-
include/iscsi_if.h | 3 +
src/apps/dhcpc/dhcpc.c | 6 +-
src/apps/dhcpc/dhcpv6.c | 8 +-
src/apps/dhcpc/dhcpv6.h | 2 +-
src/uip/ipv6.c | 222 ++++++------
src/uip/ipv6.h | 3 +-
src/uip/ipv6_ndpc.c | 87 +++--
src/uip/uip.c | 4 +-
src/uip/uip.h | 21 +-
src/uip/uip_arp.c | 8 +-
src/unix/iscsid_ipc.c | 600 ++++++++++++++++++++-----------
src/unix/libs/bnx2.c | 85 +++--
src/unix/libs/bnx2x.c | 134 ++++---
src/unix/libs/bnx2x.h | 12 +
src/unix/libs/cnic.c | 252 ++++---------
src/unix/libs/cnic.h | 3 +-
src/unix/main.c | 1 -
src/unix/nic.c | 931 +++++++++++++++++++++---------------------------
src/unix/nic.h | 50 ++-
src/unix/nic_nl.c | 404 ++++++++++++---------
src/unix/nic_utils.c | 267 +++++++-------
src/unix/nic_utils.h | 4 +-
src/unix/nic_vlan.c | 3 +-
src/unix/packet.c | 4 +-
29 files changed, 1856 insertions(+), 1529 deletions(-)
diff --git a/README b/README
index 5c36dec..a716263 100644
--- a/iscsiuio/README
+++ b/iscsiuio/README
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
-Iscsiuio Userspace Tool
-Version 0.7.2.1
@ -28,10 +65,10 @@ index 5c36dec..a716263 100644
A sample banner message:
diff --git a/iscsiuio/RELEASE.TXT b/iscsiuio/RELEASE.TXT
diff --git a/RELEASE.TXT b/RELEASE.TXT
index d4a00b6..cb1d470 100644
--- a/iscsiuio/RELEASE.TXT
+++ b/iscsiuio/RELEASE.TXT
--- a/RELEASE.TXT
+++ b/RELEASE.TXT
@@ -1,7 +1,7 @@
Release Notes
Broadcom uIP Linux Driver
@ -280,10 +317,10 @@ index d4a00b6..cb1d470 100644
3. Change: Updated README
diff --git a/iscsiuio/configure b/iscsiuio/configure
index 4879fb9..6ff2e68 100644
--- a/iscsiuio/configure
+++ b/iscsiuio/configure
diff --git a/configure b/configure
index 4879fb9..6ff2e68 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
@ -357,10 +394,10 @@ index 4879fb9..6ff2e68 100644
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
diff --git a/configure.ac b/configure.ac
index 3b7a880..0b1e7f1 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
dnl iscsiuio uIP user space stack configure.ac file
dnl
@ -381,10 +418,10 @@ index 3b7a880..0b1e7f1 100644
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CONFIG_HEADER(config.h)
diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
diff --git a/docs/iscsiuio.8 b/docs/iscsiuio.8
index 3307b1e..4bf26df 100644
--- a/iscsiuio/docs/iscsiuio.8
+++ b/iscsiuio/docs/iscsiuio.8
--- a/docs/iscsiuio.8
+++ b/docs/iscsiuio.8
@@ -3,9 +3,9 @@
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation.
@ -397,10 +434,10 @@ index 3307b1e..4bf26df 100644
.\"
.\" NAME part
.\"
diff --git a/iscsiuio/include/iscsi_if.h b/iscsiuio/include/iscsi_if.h
diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index a9ac145..1944abd 100644
--- a/iscsiuio/include/iscsi_if.h
+++ b/iscsiuio/include/iscsi_if.h
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -207,6 +207,7 @@ struct iscsi_uevent {
} ep_connect_ret;
struct msg_req_path {
@ -418,10 +455,10 @@ index a9ac145..1944abd 100644
uint16_t pmtu;
} __attribute__ ((aligned (sizeof(uint64_t))));
diff --git a/iscsiuio/src/apps/dhcpc/dhcpc.c b/iscsiuio/src/apps/dhcpc/dhcpc.c
diff --git a/src/apps/dhcpc/dhcpc.c b/src/apps/dhcpc/dhcpc.c
index 88d75c3..afec601 100644
--- a/iscsiuio/src/apps/dhcpc/dhcpc.c
+++ b/iscsiuio/src/apps/dhcpc/dhcpc.c
--- a/src/apps/dhcpc/dhcpc.c
+++ b/src/apps/dhcpc/dhcpc.c
@@ -334,7 +334,7 @@ static PT_THREAD(handle_dhcp(struct uip_stack *ustack))
(uint8_t *) s->mac_addr);
@ -449,10 +486,10 @@ index 88d75c3..afec601 100644
PT_INIT(&s->pt);
diff --git a/iscsiuio/src/apps/dhcpc/dhcpv6.c b/iscsiuio/src/apps/dhcpc/dhcpv6.c
diff --git a/src/apps/dhcpc/dhcpv6.c b/src/apps/dhcpc/dhcpv6.c
index b7ae631..273cce0 100644
--- a/iscsiuio/src/apps/dhcpc/dhcpv6.c
+++ b/iscsiuio/src/apps/dhcpc/dhcpv6.c
--- a/src/apps/dhcpc/dhcpv6.c
+++ b/src/apps/dhcpc/dhcpv6.c
@@ -86,10 +86,6 @@ int dhcpv6_do_discovery(pDHCPV6_CONTEXT dhcpv6_context)
(pIPV6_HDR) dhcpv6_context->ipv6_context->ustack->network_layer;
dhcpv6_context->udp =
@ -476,10 +513,10 @@ index b7ae631..273cce0 100644
memcpy((char __FAR__ *)&opt->type.client_id.link_layer_addr,
(char __FAR__ *)dhcpv6_context->our_mac_addr, sizeof(MAC_ADDR));
pkt_len += sizeof(DHCPV6_OPT_CLIENT_ID) + sizeof(DHCPV6_OPT_HDR);
diff --git a/iscsiuio/src/apps/dhcpc/dhcpv6.h b/iscsiuio/src/apps/dhcpc/dhcpv6.h
diff --git a/src/apps/dhcpc/dhcpv6.h b/src/apps/dhcpc/dhcpv6.h
index 917cf35..d8e03e5 100644
--- a/iscsiuio/src/apps/dhcpc/dhcpv6.h
+++ b/iscsiuio/src/apps/dhcpc/dhcpv6.h
--- a/src/apps/dhcpc/dhcpv6.h
+++ b/src/apps/dhcpc/dhcpv6.h
@@ -164,7 +164,7 @@ typedef struct DHCPV6_OPT_CLIENT_ID {
#define DHCPV6_DUID_TYPE_LINK_LAYER 3
u16_t hw_type;
@ -489,10 +526,10 @@ index 917cf35..d8e03e5 100644
MAC_ADDR link_layer_addr;
} DHCPV6_OPT_CLIENT_ID, *pDHCPV6_OPT_CLIENT_ID;
diff --git a/iscsiuio/src/uip/ipv6.c b/iscsiuio/src/uip/ipv6.c
diff --git a/src/uip/ipv6.c b/src/uip/ipv6.c
index 594495a..a8eed71 100644
--- a/iscsiuio/src/uip/ipv6.c
+++ b/iscsiuio/src/uip/ipv6.c
--- a/src/uip/ipv6.c
+++ b/src/uip/ipv6.c
@@ -38,6 +38,7 @@
*/
#include <stdio.h>
@ -953,10 +990,10 @@ index 594495a..a8eed71 100644
ra_flags, task);
return task;
diff --git a/iscsiuio/src/uip/ipv6.h b/iscsiuio/src/uip/ipv6.h
diff --git a/src/uip/ipv6.h b/src/uip/ipv6.h
index 167f5f6..ed2f3a4 100644
--- a/iscsiuio/src/uip/ipv6.h
+++ b/iscsiuio/src/uip/ipv6.h
--- a/src/uip/ipv6.h
+++ b/src/uip/ipv6.h
@@ -343,7 +343,8 @@ int ipv6_add_prefix_entry(pIPV6_CONTEXT ipv6_context,
IPV6_ADDR * ipv6_addr, u8_t prefix_len);
void ipv6_set_ip_params(pIPV6_CONTEXT ipv6_context,
@ -967,10 +1004,10 @@ index 167f5f6..ed2f3a4 100644
void ipv6_set_host_addr(pIPV6_CONTEXT ipv6_context, pIPV6_ADDR src_ip);
int ipv6_get_default_router_ip_addrs(pIPV6_CONTEXT ipv6_context,
pIPV6_ADDR ip_addr);
diff --git a/iscsiuio/src/uip/ipv6_ndpc.c b/iscsiuio/src/uip/ipv6_ndpc.c
diff --git a/src/uip/ipv6_ndpc.c b/src/uip/ipv6_ndpc.c
index 6d101ce..89dbd5e 100644
--- a/iscsiuio/src/uip/ipv6_ndpc.c
+++ b/iscsiuio/src/uip/ipv6_ndpc.c
--- a/src/uip/ipv6_ndpc.c
+++ b/src/uip/ipv6_ndpc.c
@@ -65,6 +65,7 @@ static PT_THREAD(handle_ndp(struct uip_stack *ustack, int force))
pIPV6_CONTEXT ipv6c;
pDHCPV6_CONTEXT dhcpv6c = NULL;
@ -1149,10 +1186,10 @@ index 6d101ce..89dbd5e 100644
break;
}
return ret;
diff --git a/iscsiuio/src/uip/uip.c b/iscsiuio/src/uip/uip.c
diff --git a/src/uip/uip.c b/src/uip/uip.c
index 9c79e07..d03b92e 100644
--- a/iscsiuio/src/uip/uip.c
+++ b/iscsiuio/src/uip/uip.c
--- a/src/uip/uip.c
+++ b/src/uip/uip.c
@@ -1403,8 +1403,6 @@ void uip_process(struct uip_stack *ustack, u8_t flag)
#endif /* UIP_UDP */
@ -1171,10 +1208,10 @@ index 9c79e07..d03b92e 100644
} else {
tcp_ipv4_hdr->proto = UIP_PROTO_TCP;
uip_ip4addr_copy(tcp_ipv4_hdr->srcipaddr, ustack->hostaddr);
diff --git a/iscsiuio/src/uip/uip.h b/iscsiuio/src/uip/uip.h
diff --git a/src/uip/uip.h b/src/uip/uip.h
index 2b5f88c..ccac680 100644
--- a/iscsiuio/src/uip/uip.h
+++ b/iscsiuio/src/uip/uip.h
--- a/src/uip/uip.h
+++ b/src/uip/uip.h
@@ -1031,6 +1031,7 @@ extern u16_t uip_urglen, uip_surglen;
*/
struct __attribute__ ((__packed__)) uip_conn {
@ -1225,10 +1262,10 @@ index 2b5f88c..ccac680 100644
#define UIP_SUPPORT_IPv6_ENABLED 0x01
#define UIP_SUPPORT_IPv6_DISABLED 0x02
u8_t enable_IPv6;
diff --git a/iscsiuio/src/uip/uip_arp.c b/iscsiuio/src/uip/uip_arp.c
diff --git a/src/uip/uip_arp.c b/src/uip/uip_arp.c
index 321281c..3ef3b07 100644
--- a/iscsiuio/src/uip/uip_arp.c
+++ b/iscsiuio/src/uip/uip_arp.c
--- a/src/uip/uip_arp.c
+++ b/src/uip/uip_arp.c
@@ -265,10 +265,14 @@ uip_arp_arpin(nic_interface_t * nic_iface,
arp->sipaddr[0] = ustack->hostaddr[0];
arp->sipaddr[1] = ustack->hostaddr[1];
@ -1246,10 +1283,10 @@ index 321281c..3ef3b07 100644
pkt->buf_size = sizeof(*arp) + sizeof(*eth);
}
break;
diff --git a/iscsiuio/src/unix/iscsid_ipc.c b/iscsiuio/src/unix/iscsid_ipc.c
diff --git a/src/unix/iscsid_ipc.c b/src/unix/iscsid_ipc.c
index 6bc5c11..d7372fc 100644
--- a/iscsiuio/src/unix/iscsid_ipc.c
+++ b/iscsiuio/src/unix/iscsid_ipc.c
--- a/src/unix/iscsid_ipc.c
+++ b/src/unix/iscsid_ipc.c
@@ -70,20 +70,34 @@ struct iscsid_options {
pthread_t thread;
};
@ -2088,10 +2125,10 @@ index 6bc5c11..d7372fc 100644
LOG_ERR(PFX "Could not read data: %d(%s)",
errno, strerror(errno));
goto error;
diff --git a/iscsiuio/src/unix/libs/bnx2.c b/iscsiuio/src/unix/libs/bnx2.c
diff --git a/src/unix/libs/bnx2.c b/src/unix/libs/bnx2.c
index 112d570..a8300c2 100644
--- a/iscsiuio/src/unix/libs/bnx2.c
+++ b/iscsiuio/src/unix/libs/bnx2.c
--- a/src/unix/libs/bnx2.c
+++ b/src/unix/libs/bnx2.c
@@ -295,7 +295,7 @@ static int bnx2_uio_verify(nic_t * nic)
LOG_INFO(PFX "%s: Verified is a cnic_uio device", nic->log_name);
@ -2345,10 +2382,10 @@ index 112d570..a8300c2 100644
return -EAGAIN;
}
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
diff --git a/src/unix/libs/bnx2x.c b/src/unix/libs/bnx2x.c
index fa32fbc..5e33420 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
--- a/src/unix/libs/bnx2x.c
+++ b/src/unix/libs/bnx2x.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009-2011, Broadcom Corporation
@ -2686,10 +2723,10 @@ index fa32fbc..5e33420 100644
bp->tx_cons = hw_cons;
break;
diff --git a/iscsiuio/src/unix/libs/bnx2x.h b/iscsiuio/src/unix/libs/bnx2x.h
diff --git a/src/unix/libs/bnx2x.h b/src/unix/libs/bnx2x.h
index 8e923b9..b758179 100644
--- a/iscsiuio/src/unix/libs/bnx2x.h
+++ b/iscsiuio/src/unix/libs/bnx2x.h
--- a/src/unix/libs/bnx2x.h
+++ b/src/unix/libs/bnx2x.h
@@ -467,6 +467,18 @@ struct client_init_general_data {
#define BAR_XSTRORM_INTMEM 0x420000
#define BAR_TSTRORM_INTMEM 0x430000
@ -2709,10 +2746,10 @@ index 8e923b9..b758179 100644
#define USTORM_RX_PRODS_OFFSET(port, client_id) \
(IS_E1H_OFFSET ? (0x1000 + (port * 0x680) + (client_id * 0x40)) \
: (0x4000 + (port * 0x360) + (client_id * 0x30)))
diff --git a/iscsiuio/src/unix/libs/cnic.c b/iscsiuio/src/unix/libs/cnic.c
diff --git a/src/unix/libs/cnic.c b/src/unix/libs/cnic.c
index 841c1ac..a81d47b 100644
--- a/iscsiuio/src/unix/libs/cnic.c
+++ b/iscsiuio/src/unix/libs/cnic.c
--- a/src/unix/libs/cnic.c
+++ b/src/unix/libs/cnic.c
@@ -125,6 +125,7 @@ static int cnic_arp_send(nic_t * nic, nic_interface_t * nic_iface, int fd,
memcpy(arp->arp_tpa, &dst_ip, 4);
@ -3135,10 +3172,10 @@ index 841c1ac..a81d47b 100644
else {
LOG_DEBUG(PFX "%s: unknown ip_addr_len: %d size dropping ",
nic->log_name, path->ip_addr_len);
diff --git a/iscsiuio/src/unix/libs/cnic.h b/iscsiuio/src/unix/libs/cnic.h
diff --git a/src/unix/libs/cnic.h b/src/unix/libs/cnic.h
index 738deb8..679dab8 100644
--- a/iscsiuio/src/unix/libs/cnic.h
+++ b/iscsiuio/src/unix/libs/cnic.h
--- a/src/unix/libs/cnic.h
+++ b/src/unix/libs/cnic.h
@@ -48,6 +48,7 @@ int cnic_nl_open();
void cnic_nl_close();
@ -3148,10 +3185,10 @@ index 738deb8..679dab8 100644
+ nic_interface_t *nic_iface);
#endif /* __CNIC_NL_H__ */
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
diff --git a/src/unix/main.c b/src/unix/main.c
index 4f548e9..2008913 100644
--- a/iscsiuio/src/unix/main.c
+++ b/iscsiuio/src/unix/main.c
--- a/src/unix/main.c
+++ b/src/unix/main.c
@@ -141,7 +141,6 @@ signal_wait:
break;
case SIGUSR1:
@ -3160,10 +3197,10 @@ index 4f548e9..2008913 100644
fini_logger(SHUTDOWN_LOGGER);
rc = init_logger(main_log.log_file);
if (rc != 0)
diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
diff --git a/src/unix/nic.c b/src/unix/nic.c
index 0934b56..0b3c538 100644
--- a/iscsiuio/src/unix/nic.c
+++ b/iscsiuio/src/unix/nic.c
--- a/src/unix/nic.c
+++ b/src/unix/nic.c
@@ -64,6 +64,7 @@
#include "bnx2.h"
@ -4483,10 +4520,10 @@ index 0934b56..0b3c538 100644
pthread_mutex_unlock(&nic->nic_mutex);
LOG_INFO(PFX "%s: nic loop thread exited", nic->log_name);
diff --git a/iscsiuio/src/unix/nic.h b/iscsiuio/src/unix/nic.h
diff --git a/src/unix/nic.h b/src/unix/nic.h
index 57d89b4..da900c5 100644
--- a/iscsiuio/src/unix/nic.h
+++ b/iscsiuio/src/unix/nic.h
--- a/src/unix/nic.h
+++ b/src/unix/nic.h
@@ -67,6 +67,8 @@ extern struct nic_lib_handle *nic_lib_list;
extern pthread_mutex_t nic_list_mutex;
extern struct nic *nic_list;
@ -4619,10 +4656,10 @@ index 57d89b4..da900c5 100644
int find_nic_lib_using_pci_id(uint32_t vendor, uint32_t device,
uint32_t subvendor, uint32_t subdevice,
nic_lib_handle_t ** handle,
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
diff --git a/src/unix/nic_nl.c b/src/unix/nic_nl.c
index 971f350..34e2062 100644
--- a/iscsiuio/src/unix/nic_nl.c
+++ b/iscsiuio/src/unix/nic_nl.c
--- a/src/unix/nic_nl.c
+++ b/src/unix/nic_nl.c
@@ -83,20 +83,6 @@ const static struct sockaddr_nl dest_addr = {
/* Netlink */
int nl_sock = INVALID_FD;
@ -5202,10 +5239,10 @@ index 971f350..34e2062 100644
LOG_DEBUG(PFX "Pulled nl event");
}
diff --git a/iscsiuio/src/unix/nic_utils.c b/iscsiuio/src/unix/nic_utils.c
diff --git a/src/unix/nic_utils.c b/src/unix/nic_utils.c
index fe58df8..a1d3e72 100644
--- a/iscsiuio/src/unix/nic_utils.c
+++ b/iscsiuio/src/unix/nic_utils.c
--- a/src/unix/nic_utils.c
+++ b/src/unix/nic_utils.c
@@ -65,7 +65,7 @@
*****************************************************************************/
static const char nic_uio_sysfs_name_tempate[] = "/sys/class/uio/uio%i/name";
@ -5637,10 +5674,10 @@ index fe58df8..a1d3e72 100644
LOG_ERR("Could not read capture, path: %s len: %d [%s]",
path, file_size, strerror(ferror(fp)));
free(*raw);
diff --git a/iscsiuio/src/unix/nic_utils.h b/iscsiuio/src/unix/nic_utils.h
diff --git a/src/unix/nic_utils.h b/src/unix/nic_utils.h
index ff76f6b..6c57701 100644
--- a/iscsiuio/src/unix/nic_utils.h
+++ b/iscsiuio/src/unix/nic_utils.h
--- a/src/unix/nic_utils.h
+++ b/src/unix/nic_utils.h
@@ -67,7 +67,9 @@ void nic_fill_ethernet_header(nic_interface_t * nic_iface,
int *pkt_size, void **start_addr,
uint16_t ether_type);
@ -5652,10 +5689,10 @@ index ff76f6b..6c57701 100644
void set_nic_iface(nic_t *nic, nic_interface_t *nic_iface);
void persist_all_nic_iface(nic_t * nic);
diff --git a/iscsiuio/src/unix/nic_vlan.c b/iscsiuio/src/unix/nic_vlan.c
diff --git a/src/unix/nic_vlan.c b/src/unix/nic_vlan.c
index 4f8f551..90a6244 100644
--- a/iscsiuio/src/unix/nic_vlan.c
+++ b/iscsiuio/src/unix/nic_vlan.c
--- a/src/unix/nic_vlan.c
+++ b/src/unix/nic_vlan.c
@@ -332,7 +332,8 @@ int find_vlans_using_phy_interface(struct vlan_handle *handle,
*/
int valid_vlan(short int vlan)
@ -5666,10 +5703,10 @@ index 4f8f551..90a6244 100644
return 1;
return 0;
diff --git a/iscsiuio/src/unix/packet.c b/iscsiuio/src/unix/packet.c
diff --git a/src/unix/packet.c b/src/unix/packet.c
index 4d8bf55..5047030 100644
--- a/iscsiuio/src/unix/packet.c
+++ b/iscsiuio/src/unix/packet.c
--- a/src/unix/packet.c
+++ b/src/unix/packet.c
@@ -88,7 +88,7 @@ void free_packet(struct packet *pkt)
* reset_packet() - This will reset the packet fields to default values
* @param pkt - the packet to reset
@ -5688,3 +5725,6 @@ index 4d8bf55..5047030 100644
{
int rc, i;
--
1.7.11.7

View File

@ -1,26 +1,25 @@
From b15710a9b96c15e8cdcf3dcfda7b40559d565b3c Mon Sep 17 00:00:00 2001
From: Eddie Wai <eddie.wai@broadcom.com>
Date: Mon, 15 Oct 2012 14:47:54 -0700
Subject: [PATCH] ISCSIUIO: Updated to 0.7.6.1
From 057e4ade3814e3ae41a4226c63e76cc36c8147bf Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:28:18 -0800
Subject: iscsiuio 0.7.6.1
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
---
iscsiuio/README | 4 ++--
iscsiuio/RELEASE.TXT | 34 ++++++++++++++++++++++++++++++++--
iscsiuio/configure | 18 +++++++++---------
iscsiuio/configure.ac | 4 ++--
iscsiuio/docs/iscsiuio.8 | 4 ++--
iscsiuio/src/uip/uip_arp.c | 1 -
iscsiuio/src/unix/libs/bnx2x.c | 19 ++++++++++++++++---
iscsiuio/src/unix/libs/bnx2x.h | 8 +++++++-
iscsiuio/src/unix/nic.c | 3 ++-
iscsiuio/src/unix/nic_nl.c | 2 +-
README | 4 ++--
RELEASE.TXT | 34 ++++++++++++++++++++++++++++++++--
configure | 18 +++++++++---------
configure.ac | 4 ++--
docs/iscsiuio.8 | 4 ++--
src/uip/uip_arp.c | 1 -
src/unix/libs/bnx2x.c | 19 ++++++++++++++++---
src/unix/libs/bnx2x.h | 8 +++++++-
src/unix/nic.c | 3 ++-
src/unix/nic_nl.c | 2 +-
10 files changed, 73 insertions(+), 24 deletions(-)
diff --git a/iscsiuio/README b/iscsiuio/README
diff --git a/README b/README
index a716263..e5ee23f 100644
--- a/iscsiuio/README
+++ b/iscsiuio/README
--- a/README
+++ b/README
@@ -1,6 +1,6 @@
iscsiuio Userspace Tool
-Version 0.7.4.3
@ -30,10 +29,10 @@ index a716263..e5ee23f 100644
------------------------------------------------------
This tool is to be used in conjunction with the Broadcom NetXtreme II Linux
diff --git a/iscsiuio/RELEASE.TXT b/iscsiuio/RELEASE.TXT
diff --git a/RELEASE.TXT b/RELEASE.TXT
index cb1d470..0e7665c 100644
--- a/iscsiuio/RELEASE.TXT
+++ b/iscsiuio/RELEASE.TXT
--- a/RELEASE.TXT
+++ b/RELEASE.TXT
@@ -1,7 +1,7 @@
Release Notes
Broadcom uIP Linux Driver
@ -81,10 +80,10 @@ index cb1d470..0e7665c 100644
uIP v0.7.4.3 (Aug 16, 2012)
=======================================================
Fixes
diff --git a/iscsiuio/configure b/iscsiuio/configure
index 6ff2e68..0b2abc4 100644
--- a/iscsiuio/configure
+++ b/iscsiuio/configure
diff --git a/configure b/configure
index 6ff2e68..0b2abc4 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
@ -158,10 +157,10 @@ index 6ff2e68..0b2abc4 100644
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/iscsiuio/configure.ac b/iscsiuio/configure.ac
diff --git a/configure.ac b/configure.ac
index 0b1e7f1..1045a80 100644
--- a/iscsiuio/configure.ac
+++ b/iscsiuio/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -11,9 +11,9 @@ dnl Maintained by: Eddie Wai (eddie.wai@broadcom.com)
dnl
@ -174,10 +173,10 @@ index 0b1e7f1..1045a80 100644
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_CONFIG_HEADER(config.h)
diff --git a/iscsiuio/docs/iscsiuio.8 b/iscsiuio/docs/iscsiuio.8
diff --git a/docs/iscsiuio.8 b/docs/iscsiuio.8
index 4bf26df..d107327 100644
--- a/iscsiuio/docs/iscsiuio.8
+++ b/iscsiuio/docs/iscsiuio.8
--- a/docs/iscsiuio.8
+++ b/docs/iscsiuio.8
@@ -3,9 +3,9 @@
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation.
@ -190,10 +189,10 @@ index 4bf26df..d107327 100644
.\"
.\" NAME part
.\"
diff --git a/iscsiuio/src/uip/uip_arp.c b/iscsiuio/src/uip/uip_arp.c
diff --git a/src/uip/uip_arp.c b/src/uip/uip_arp.c
index 3ef3b07..9dd02a1 100644
--- a/iscsiuio/src/uip/uip_arp.c
+++ b/iscsiuio/src/uip/uip_arp.c
--- a/src/uip/uip_arp.c
+++ b/src/uip/uip_arp.c
@@ -273,7 +273,6 @@ uip_arp_arpin(nic_interface_t * nic_iface,
pkt->buf_size = sizeof(*arp) +
sizeof(struct uip_vlan_eth_hdr);
@ -202,10 +201,10 @@ index 3ef3b07..9dd02a1 100644
}
break;
case const_htons(ARP_REPLY):
diff --git a/iscsiuio/src/unix/libs/bnx2x.c b/iscsiuio/src/unix/libs/bnx2x.c
diff --git a/src/unix/libs/bnx2x.c b/src/unix/libs/bnx2x.c
index 5e33420..70e85c0 100644
--- a/iscsiuio/src/unix/libs/bnx2x.c
+++ b/iscsiuio/src/unix/libs/bnx2x.c
--- a/src/unix/libs/bnx2x.c
+++ b/src/unix/libs/bnx2x.c
@@ -103,6 +103,10 @@ static const char brcm_57840_MF[] = "Broadcom NetXtreme II BCM57840 MF "
"10-Gigabit";
static const char brcm_57840_VF[] = "Broadcom NetXtreme II BCM57840 VF "
@ -262,10 +261,10 @@ index 5e33420..70e85c0 100644
if (len > 0) {
msync(rx_pkt, len, MS_SYNC);
/* Copy the data */
diff --git a/iscsiuio/src/unix/libs/bnx2x.h b/iscsiuio/src/unix/libs/bnx2x.h
diff --git a/src/unix/libs/bnx2x.h b/src/unix/libs/bnx2x.h
index b758179..1f47011 100644
--- a/iscsiuio/src/unix/libs/bnx2x.h
+++ b/iscsiuio/src/unix/libs/bnx2x.h
--- a/src/unix/libs/bnx2x.h
+++ b/src/unix/libs/bnx2x.h
@@ -430,6 +430,8 @@ struct client_init_general_data {
#define CHIP_NUM_57800 0x168a
#define CHIP_NUM_57810 0x168e
@ -288,10 +287,10 @@ index b758179..1f47011 100644
#define CHIP_IS_E1H(bp) (CHIP_IS_57711(bp) || \
CHIP_IS_57711E(bp))
#define CHIP_IS_E2(bp) (CHIP_IS_57712(bp) || \
diff --git a/iscsiuio/src/unix/nic.c b/iscsiuio/src/unix/nic.c
diff --git a/src/unix/nic.c b/src/unix/nic.c
index 0b3c538..72afff0 100644
--- a/iscsiuio/src/unix/nic.c
+++ b/iscsiuio/src/unix/nic.c
--- a/src/unix/nic.c
+++ b/src/unix/nic.c
@@ -460,6 +460,7 @@ int nic_remove(nic_t * nic)
rc = stat(nic->uio_device_name, &file_stat);
if ((rc == 0) && (nic->ops))
@ -309,10 +308,10 @@ index 0b3c538..72afff0 100644
for (i = 0; i < UIP_UDP_CONNS; i++) {
prepare_ustack(nic, nic_iface, ustack, pkt);
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
diff --git a/src/unix/nic_nl.c b/src/unix/nic_nl.c
index 34e2062..8afd9ae 100644
--- a/iscsiuio/src/unix/nic_nl.c
+++ b/iscsiuio/src/unix/nic_nl.c
--- a/src/unix/nic_nl.c
+++ b/src/unix/nic_nl.c
@@ -408,7 +408,7 @@ static int ctldev_handle(char *data, nic_t *nic)
persist_all_nic_iface(nic);
@ -323,5 +322,5 @@ index 34e2062..8afd9ae 100644
/* nic_disable but not going down */
--
1.7.7.4
1.7.11.7

View File

@ -0,0 +1,31 @@
From bff9048411c891d2eafab1e588077e4bfa56cb43 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:32:44 -0800
Subject: iscsiuio fix long options
---
src/unix/main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/unix/main.c b/src/unix/main.c
index 2008913..ef9e069 100644
--- a/src/unix/main.c
+++ b/src/unix/main.c
@@ -83,9 +83,11 @@ static char default_pid_filepath[] = "/var/run/iscsiuio.pid";
* Global Variables
******************************************************************************/
static const struct option long_options[] = {
- {"debug", 0, 0, 0},
- {"version", 0, 0, 0},
- {"help", 0, 0, 0},
+ {"foreground", no_argument, NULL, 'f'},
+ {"debug", required_argument, NULL, 'd'},
+ {"pid", required_argument, NULL, 'p'},
+ {"version", no_argument, NULL, 'v'},
+ {"help", no_argument, NULL, 'h'},
{0, 0, 0, 0}
};
--
1.7.11.7

View File

@ -0,0 +1,51 @@
From fefc8e39129dbdeadf2a0b6ba7a28e9e47597e11 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:37:18 -0800
Subject: iscsiuio add --initrd option to set run from initrd hint for systemd
See http://www.freedesktop.org/wiki/Software/systemd/RootStorageDaemons
---
src/unix/main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/unix/main.c b/src/unix/main.c
index ef9e069..c5fb5ab 100644
--- a/src/unix/main.c
+++ b/src/unix/main.c
@@ -82,12 +82,15 @@ static char default_pid_filepath[] = "/var/run/iscsiuio.pid";
/*******************************************************************************
* Global Variables
******************************************************************************/
+static int initrd = 0;
+
static const struct option long_options[] = {
{"foreground", no_argument, NULL, 'f'},
{"debug", required_argument, NULL, 'd'},
{"pid", required_argument, NULL, 'p'},
{"version", no_argument, NULL, 'v'},
{"help", no_argument, NULL, 'h'},
+ {"initrd", no_argument, &initrd, 1},
{0, 0, 0, 0}
};
@@ -176,6 +179,7 @@ iscsiuio daemon.\n\
-f, --foreground make the program run in the foreground\n\
-d, --debug debuglevel print debugging information\n\
-p, --pid=pidfile use pid file (default %s).\n\
+ --initrd systemd initrd hint\n\
-h, --help display this help and exit\n\
-v, --version display version and exit\n\
", default_pid_filepath);
@@ -279,6 +283,9 @@ int main(int argc, char *argv[])
}
}
+ if (initrd)
+ argv[0][0] = '@';
+
if (main_log.enabled == LOGGER_ENABLED) {
/* initialize the logger */
rc = init_logger(main_log.log_file);
--
1.7.11.7

View File

@ -0,0 +1,58 @@
From b923362bb847eab5856fa3593f053e670d90e0fd Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 19 Dec 2012 21:39:06 -0800
Subject: iscsiuio systemd socket activation support
---
src/unix/iscsid_ipc.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/src/unix/iscsid_ipc.c b/src/unix/iscsid_ipc.c
index d7372fc..1c28822 100644
--- a/src/unix/iscsid_ipc.c
+++ b/src/unix/iscsid_ipc.c
@@ -948,6 +948,30 @@ static void *iscsid_loop(void *arg)
pthread_exit(NULL);
}
+#define SD_SOCKET_FDS_START 3
+
+static int ipc_systemd(void)
+{
+ char *env;
+
+ env = getenv("LISTEN_PID");
+
+ if (!env || (strtoul(env, NULL, 10) != getpid()))
+ return -EINVAL;
+
+ env = getenv("LISTEN_FDS");
+
+ if (!env)
+ return -EINVAL;
+
+ if (strtoul(env, NULL, 10) != 1) {
+ LOG_ERR("Did not receive exactly one IPC socket from systemd");
+ return -EINVAL;
+ }
+
+ return SD_SOCKET_FDS_START;
+}
+
/******************************************************************************
* Initialize/Cleanup routines
******************************************************************************/
@@ -961,6 +985,10 @@ int iscsid_init()
int rc;
struct sockaddr_un addr;
+ iscsid_opts.fd = ipc_systemd();
+ if (iscsid_opts.fd >= 0)
+ return 0;
+
iscsid_opts.fd = socket(AF_LOCAL, SOCK_STREAM, 0);
if (iscsid_opts.fd < 0) {
LOG_ERR(PFX "Can not create IPC socket");
--
1.7.11.7

View File

@ -0,0 +1,62 @@
From 07bf3074ccdd9debe844fe1bae0244799d01fe58 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Wed, 2 Jan 2013 14:46:14 -0800
Subject: iscsiuio: iscsid IPC newroot command
---
include/uip_mgmt_ipc.h | 4 ++++
src/unix/iscsid_ipc.c | 9 +++++++++
2 files changed, 13 insertions(+)
diff --git a/include/uip_mgmt_ipc.h b/include/uip_mgmt_ipc.h
index 7054df5..db87b2b 100644
--- a/include/uip_mgmt_ipc.h
+++ b/include/uip_mgmt_ipc.h
@@ -26,6 +26,7 @@
typedef enum iscsid_uip_cmd {
ISCSID_UIP_IPC_UNKNOWN = 0,
ISCSID_UIP_IPC_GET_IFACE = 1,
+ ISCSID_UIP_NEWROOT = 2,
__ISCSID_UIP_IPC_MAX_COMMAND
} iscsid_uip_cmd_e;
@@ -45,6 +46,9 @@ typedef struct iscsid_uip_broadcast {
struct ipc_broadcast_iface_rec {
struct iface_rec rec;
} iface_rec;
+ struct ipc_broadcast_newroot {
+ char path[PATH_MAX + 1];
+ } newroot;
} u;
} iscsid_uip_broadcast_t;
diff --git a/src/unix/iscsid_ipc.c b/src/unix/iscsid_ipc.c
index 1c28822..dcbeb4c 100644
--- a/src/unix/iscsid_ipc.c
+++ b/src/unix/iscsid_ipc.c
@@ -801,6 +801,7 @@ int process_iscsid_broadcast(int s2)
size_t size;
iscsid_uip_cmd_e cmd;
uint32_t payload_len;
+ char *newroot;
fd = fdopen(s2, "r+");
if (fd == NULL) {
@@ -857,6 +858,14 @@ int process_iscsid_broadcast(int s2)
}
break;
+ case ISCSID_UIP_NEWROOT:
+ rsp.command = cmd;
+ newroot = data->u.newroot.path;
+ if (chdir(newroot) || chroot(".") || chdir("/"))
+ rsp.err = ISCSID_UIP_MGMT_IPC_ERR;
+ else
+ rsp.err = ISCSID_UIP_MGMT_IPC_OK;
+ break;
default:
LOG_WARN(PFX "Unknown iscsid broadcast command: %x",
data->header.command);
--
1.7.11.7

View File

@ -0,0 +1,32 @@
From 1453c612ce34c6d3722e0d83b5e2def5048421dc Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 21 Jan 2013 15:49:02 -0800
Subject: iscsiuio document pidfile option
---
docs/iscsiuio.8 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/iscsiuio.8 b/docs/iscsiuio.8
index d107327..6d79108 100644
--- a/docs/iscsiuio.8
+++ b/docs/iscsiuio.8
@@ -67,6 +67,15 @@ into the background.
.TP
.BI -v
This is to print the version.
+.PP
+.TP
+.BI -p <pidfile>
+Use pidfile (default /var/run/iscsiuio.pid )
+.PP
+.TP
+.BI -h
+Display this help and exit.
+
.\"
.\" AUTHOR part
--
1.7.11.7

View File

@ -0,0 +1,25 @@
From 1483a176fdbb22bbfecf06eea57d1aa200f30561 Mon Sep 17 00:00:00 2001
From: Chris Leech <cleech@redhat.com>
Date: Mon, 21 Jan 2013 15:43:36 -0800
Subject: use Red Hat version string to match RPM package version
---
usr/version.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr/version.h b/usr/version.h
index a090522..aef0c3d 100644
--- a/usr/version.h
+++ b/usr/version.h
@@ -6,7 +6,7 @@
* This may not be the same value as the kernel versions because
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.0-873"
+#define ISCSI_VERSION_STR "6.2.0.873-1"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif
--
1.7.11.7

View File

@ -1,17 +1,7 @@
#!/bin/sh
export LC_ALL=C
if [ "$2" = "down" ]; then
if ! /sbin/ip route ls | grep -q ^default &&
[ -f /var/lock/subsys/iscsi ]; then
/etc/rc.d/init.d/iscsi stop
fi
fi
if [ "$2" = "up" ]; then
if /sbin/ip -o route show dev "$1" | grep -q '^default' &&
/sbin/chkconfig iscsi; then
/etc/rc.d/init.d/iscsi start
fi
fi
case "$2" in
up|down|vpn-up|vpn-down)
/bin/systemctl try-restart iscsi.service || :
;;
esac

View File

@ -1,85 +0,0 @@
From e35bdee97477e65866b2c110f0e4b1affe4e983d Mon Sep 17 00:00:00 2001
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Date: Wed, 12 Oct 2011 19:12:03 +0530
Subject: [PATCH 1/2] iscsi tools: Add Netconfig support through libiscsi
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
---
libiscsi/libiscsi.c | 25 +++++++++++++++++++++++++
libiscsi/libiscsi.h | 16 ++++++++++++++++
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index 42f2e3b..dc63fcd 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -38,9 +38,13 @@
#include "fw_context.h"
#include "iscsid_req.h"
#include "iscsi_err.h"
+#include "iscsi_ipc.h"
+#include "transport.h"
#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
+extern struct iscsi_ipc *ipc;
+
/* UGLY, not thread safe :( */
static int sysfs_initialized = 0;
@@ -610,3 +614,24 @@ int libiscsi_get_firmware_initiator_name(char *initiatorname)
return 0;
}
+
+int libiscsi_set_netconfig(struct libiscsi_context *context,
+ uint32_t host_no, char *transport_name,
+ struct iovec *iovs, int param_count)
+{
+ struct iscsi_transport *t = NULL;
+ int fd;
+ int rc = 1;
+
+ t = iscsi_sysfs_get_transport_by_name(transport_name);
+ if (!t)
+ return ENODEV;
+
+ fd = ipc->ctldev_open();
+ if (fd < 0)
+ return ENODEV;
+
+ rc = ipc->set_net_config(t->handle, host_no, iovs, param_count);
+ ipc->ctldev_close();
+ return rc;
+}
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h
index 756590e..61ce0ea 100644
--- a/libiscsi/libiscsi.h
+++ b/libiscsi/libiscsi.h
@@ -335,6 +335,22 @@ PUBLIC int libiscsi_get_firmware_network_config(
*/
PUBLIC int libiscsi_get_firmware_initiator_name(char *initiatorname);
+/** \brief Set Network Configuration Settings
+ *
+ * Set Network Configuration Settings
+ *
+ * \param context libiscsi context to operate on.
+ * \param host_no Host number of the port.
+ * \param transport_name Transport Class Name.
+ * \param iovs Pointer to IO Vectors of Netconfig paramaters.
+ * \param param_count Number to IO Vectors.
+ *
+ * \return 0 on success, ENODEV when set netconfig failed.
+ */
+PUBLIC int libiscsi_set_netconfig(struct libiscsi_context *context,
+ uint32_t host_no, char *transport_name,
+ struct iovec *iovs, int param_count);
+
#undef PUBLIC
#ifdef __cplusplus
--
1.7.1

View File

@ -1,359 +0,0 @@
From ba0a0bccb38dfb443c24a1090dc6c18c9b1d2939 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Sun, 20 May 2012 19:59:24 -0500
Subject: [PATCH] Prep for open-iscsi-2.0.873 release
Update Changelog, README and version.h for new release.
---
Changelog | 252 +++++++++++++++++++++++++++++++++-------------------------
README | 35 +++++---
usr/version.h | 2 +-
3 files changed, 171 insertions(+), 118 deletions(-)
diff --git a/Changelog b/Changelog
index c1df8bd..880ae43 100644
--- a/Changelog
+++ b/Changelog
@@ -1,114 +1,152 @@
-open-iscsi-2.0-872 - open-iscsi-2.0.871
+open-iscsi-2.0-872 - open-iscsi-2.0.873
-Avi Kaplan (2):
- Remove unused field iscsi_conn from struct iscsi_sw_tcp_conn
- Change restore_callbacks argument iscsi_sw_tcp_conn to iscsi_conn
+Ales Kozumplik (1):
+ fwparam_sysfs: fix pathname manipulation error in fwparam_sysfs_boot_info.
-Erez Zilber (1):
- Fix 2.6.14-23_compat.patch to support all RHEL 5.X versions
+Eddie Wai (3):
+ ISCSID: Fixed a race condition in the INVALID_HOST path
+ ISCSID: Fixed iface update for the new iface net config params
+ ISCSIADM: Included the new iface net params to the node creation
-Hannes Reinecke (2):
- Allow update of discovery records.
- Update 2.6.27_compat.patch for SLES 11
+Hannes Reinecke (6):
+ iscsid sends SIGTERM to PID 0
+ iscsid: Implement --no-pid-file
+ Keep startup mode in sync when specified in config file
+ Allow LOCK_DIR to be set via CFLAGS
+ Allow 'onboot' as loginall parameter
+ boot.suse: Update with latest fixes
-Mike Christie (91):
- Don't kill iscsid if logout from all nodes fail
- iscsid: fix ISCSI_ERR_INVALID_HOST err handling
- iscsid: add flag to indicate if driver needs iscsid to set ip
- iscsid: add be2iscsi template
- iscsid be2iscsi: add more driver limits
- iscsid: start iscsid automatically when needed
- iscsid: fix segfault during session sync up
- iscsiadm: fix discovery record use
- iscsi mod: sync to linux-2.6-iscsi tree's 2.6.33 feature window patches
- iscsid: handle new replacement_timeout values
- iscsi tools: support tgt reset timeout
- iscsi-iname: fix misleading help description
- iscsid: fix iferror log message
- iscsi mod: Update 2.6.14-23_compat.patch patch
- iscsiadm: fix login/logout message
- do not use a semarg in shared-mem for semop calls
- Fix wrong logs in log.c
- update 2.6.26 compat patch
- iscsi tools: Allow empty username for CHAP
- iscsi ibft/boot: fix net dev loopup
- iscsistart option to bring up NICs using configuration in iBFT.
- ibft boot: mv setup nics to fw_entry.c so iscsiadm can use it
- iscsistart ibft: fix fwparam network cmd
- iscsid be2iscsi: don't set set_host_ip
- iscsi tools: merge functions to get net iface name from mac address
- ibft boot: do not setup nic if offload can be used
- iscsistart ibft boot: setup iscsi offload during boot
- ibft boot: remove be2iscsi
- iscsi tools: idbm/fw function cleanup
- iscsi tool: trivial fixes
- ibft boot: add offload ibft support to iscsiadm
- iscsiadm: only do auto iface setup when iface mode is run
- ibft boot: add iscsiadm offload ibft rec support
- doc: add iscsistart man page
- doc: add iscsi-iname man page
- ibft boot: fix dev to iface matching
- offload boot: turn off
- iscsi tools: nic setup cleanup
- iscsi tools: fix compile errors
- iscsi kern: fix 2.6.27 compat patch
- iscsiadm: add nonpersistent mode to discovery mode
- iscsi tool: mv idbm_node_setup_defaults to idbm.c
- iscsi tools: cleanup get_global_string_param use
- iscsi tools: make config file parser a little smarter.
- iscsiadm: mv session management functions to new file
- st discovery: fix reopen max handling
- iscsid: have iscsid watch for new portals using sendtargets
- iscsi tools: mv iscsid request helpers to its own file
- iscsi tools: add str prefix to strings.c functions
- iscsi tools: use open-isns services
- iscsi tools: add MaxXmitDataSegmentLength param
- iscsi tools: do not exit on mem alloc failures during discovery
- Fix makefile cleanup
- iscsid: add isns discovery daemon and SCN support
- iscsid: support discovery daemon auto logout
- isns: fix compilation
- iscsi tools: fix null sysfs string handling
- iscsi tools: fix compilation on s390
- Update version number to 872
- iscsi tools: fix MaxXmitDataSegmentLength=0 handling
- be2iscsi iscsi tool: fix MaxXmitDataSegmentLength handling
- iscsi tools: be2iscsi: fix initial_r2t_en handling
- iscsi tools: prep for userspace libiscsi
- iscsi tools: add log_info helper
- iscsi tools: fix port handling for iscsiadm commands
- iscsi tools: fix port handling for iscsiadm commands take 2
- iscsid: fix discoveryd shutdown
- iscsi scripts: use iscsiadm -k to shutdown daemon
- iscsiadm: fix discovery record management
- iscsid: fix sendtargets discovery daemon CHAP handling
- iscsiadm: mv disc code to new function
- iscsiadm: fix disc port handling
- iscsiadm: add new discovery mode
- iscsiadm: add isns db support
- iscsiadm: cleanup default port handling
- iscsid: use isns discovery rec for isns discoveryd setttings
- iscsiadm: fix iface mode ENODEV handling
- iscsiadm: mark discovery mode as depreciated
- sync to upstream
- 2.6.33 - 34 kernel compat patch
- 2.6.28 - 32 kernel compat patch
- 2.6.27 kernel compat patch
- 2.6.26 kernel compat patch
- 2.6.24 - 25 kernel compat patch
- 2.6.14 - 23 kernel compat patch
- iscsiadm: fix discovery2 db op return value
- iscsiadm: print isns recs in discovery mode
- iscsi boot: add support for iscsi boot sysfs module
- iscsiadm: rename discovery2 mode as discoverydb
- iscsiadm: fix boot code compile error
- iscsiadm: fix iface update/delete return value fix
+Jim Ramsay (12):
+ Add specific session information to session_rec_t
+ Add support for multiple sessions per iface to iscsid
+ Add multiple sessions per iface commandline syntax
+ Add new node.session.nr_sessions config parameter
+ Implement leading-login support
+ Fix dcb_app.c compile error with old kernels
+ Check all ifaces during discovery even if some timeout
+ iscsid: In foreground mode, treat SIGINT like SIGTERM
+ Revise bind_conn_to_iface logic
+ iscsi tools: Fix warnings reported by gcc-4.5.2
+ fwparam_ibft: Fix warnings reported by gcc-4.5.2
+ open-isns: Fix warnings reported by gcc-4.5.2
-Ritesh Raj Sarraf (3):
- fix some spelling errors reported by lintian
- minor manpage updates
- Fix CVE-2009-1297
+Karen Xie (1):
+ open-iscsi: add transport cxgb4i
-Wulf C. Krueger (1):
- Use DESTDIR when generating an InitiatorName.
+Lalit Chandivade (2):
+ iscsiadm: add netconfig support
+ iscsi tools: manage qla4xxx iscsi sessions with iscsiadm
+
+Manish Rangankar (1):
+ iscsid: Fixed iscsid restart issue for offload iSCSI login
+
+Mark Rustad (7):
+ Add some consts to char * parameters that are not changed
+ Add dcb_app.h for DCB support
+ Add dcb_app.c for DCB support
+ Add initial DCB support
+ iscsid: Fix netdev check
+ Remove redundant initialization
+ iscsid: Add IEEE DCB support
+
+Mike Christie (86):
+ iscsid: remove bogus debug log msg in isns_disc_new_portals
+ isns: Fix endless loop when pollhup is returned
+ iscsi tools: fix multi pdu sendtargets discovery sequences
+ iscsi boot: fix iscsi_boot sysfs parsing
+ Use pass through interface for sendtargets (take4) Currenly offload cards like bnx2i, be2iscsi, cxgb3i must use a normal eth for discovery. This patch allows us to do discovery using the iscsi class passthrough interface.
+ Add userspace/tools iscsi error code defs
+ iscsi tools: fix iscsiadm exit codes
+ iscsid: modify data drop
+ iscsi doc: document iscsiadm host argument
+ iscsid: add new auth error code
+ iscsi tools: convert discovery code to iscsi error codes
+ iscsi tools: document iface rp_filter use
+ iscsi tools: disable isns dsa code
+ iscsi tools: support hostnames in node mode
+ iscsi tools: fix discovery return code
+ iscsiadm: fix offload discovery retry
+ iscsid: fix signal handler debug msg
+ iscsiadm: fix discovery exit code
+ iscsi tools: fix dcbnl.h compile error
+ iscsid: retry initial connect
+ iscsi tools/kernel: switch make defaults
+ iscsi tools: fix comment about sysfs lookup failures
+ iscsi tools: fix netlink bug allocation
+ iscsi tools: Don't try to bind offload EPs to sockets
+ iscsi tools: fix oom_adj use
+ iscsi tools: fix bnx2i boot due to MAC mismatch
+ iscsiadm: fix discoverydb help
+ Update SUSE init script
+ iscsi tools: revert commit c440cbe7ba2464f8baadedb55b00754c36773c2c
+ Add a TODO
+ TODO: mark down Jose as working on idr
+ Update TODO
+ iscsi tools: fix iname sysfs handling
+ iscsi tools: handle compile warnings about unused variables
+ iscsiadm: print kernel iface info
+ iscsi tools: add tgt reset to session info and fix unknown values
+ iscsi tools: fix default iface binding setup
+ iscsi tools: fix iscsiadm return value on failed login
+ iscsi tools: don't build with openssl
+ iscsi tools: check NULL pointer first and add limit check in str_remove_initial
+ iscsi tools: fix README sid lookup info
+ iscsid: print out more informative error string for kernel errors
+ iscsi tools: fix netlink msg setup
+ iscsi tools: fix up vlan support
+ update todo
+ iscsiadm: fix printing of unknown host values
+ Do not run configure for open-isns on every build
+ iscsi tools: fix ipv6 ibft/firmware boot
+ iscsid: don't sync qla4xxx flash sessions
+ iscsid: kill session if already exists.
+ isns: remove rfc files.
+ iscsistart: allow any rec/iscsid.conf setting as arg
+ iscsistart: support params in offload/ibft mode
+ iscsi tools: never use hdr digest with iser
+ iscsi tools: update iscsi_if.h for host event
+ iscsi tools: added ping support
+ iscsi tools: Add support to display a host's CHAP list and delete
+ iscsi tools: fix conn state compilation warnings
+ iscsi tools: allow default to have different transort names
+ iscsiadm: print ping status string
+ iscsi tools: fix hostname with port handling
+ iscsi tools: have iscsid/iscsiadm load modules as needed
+ iscsi tools: have iscsiadm load offload modules
+ init: update red hat init script for module changes
+ iscsi tools: create def ifaces on demand
+ iscsi tools: iscsiadm modprobe support
+ iscsi tools: remove class version check
+ iscsi tools: remove unused len variable
+ iscsiadm: support multiple params in one call
+ iscsid: remove DCB support
+ iscsiadm: print port speed and link state
+ iscsi tools: check for loaded module before loading
+ iscsistart: have iscsistart use same multi param code as iscsiadm
+ iscsi tools: print and load boot transport
+ iscsiadm: load iface before checking for hostno/mac match
+ iscsistart: fix iface overriding
+ iscsiadm: make sure offload drivers are loaded in host mode
+ iscsi tools: have iscsi tools bring up offload net iface
+ iscsi tools: fix bnx2i login
+ iscsi tools: fix ipv6 handling
+ iscsistart: fix invalid param handling
+ iscsiadm: added command line option '--interval'
+ iscsi tools: fix unknown param warnings
+ iscsi tools: fix socket leak in transport probe
+ iscsi tools: remove useless NULL iface check
+ iscsi tools: use strlpy in net code
+
+Nilesh Javali (1):
+ iscsi tools: update documents for CHAP command
+
+Rahul Gupta (1):
+ iscsi tools: Displaying timeout and CHAP in iscisadm info
+
+Vikas Chaudhary (2):
+ iscsi tools: update documents for ping command
+ iscsi tools: remove un-necessary print message
+
+Wang Sheng-Hui (1):
+ usr/config.h: fix comment for struct iscsi_session_timeout_config
diff --git a/README b/README
index 0f6293f..3bca590 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@
=================================================================
- July 1, 2010
+ May 20, 2012
Contents
========
@@ -74,29 +74,44 @@ the cache sync command will fail.
- iscsiadm's -P 3 option will not print out scsi devices.
- iscsid will not automatically online devices.
-By default the kernel source found at
+By default the kernel's iSCSI modules will be used. Running:
+
+ make
+ make install
+
+will install the iSCSI tools iscsiadm and iscsid to /sbin.
+
+For 2.6.14 - 2.6.34 the modules in the kernel dir can built and install
+by running:
+
+ make kernel
+
+When building those modules the kernel source found at
/lib/modules/`uname -a`/build
will be used to compile the open-iscsi modules. To specify a different
kernel to build against use:
- make KSRC=<kernel-src>
+ make kernel KSRC=<kernel-src>
or cross-compilation:
- make KSRC=<kernel-src> KARCH="ARCH=um"
+ make kernel KSRC=<kernel-src> KARCH="ARCH=um"
To compile on SUSE Linux you'll have to use
- make KSRC=/usr/src/linux \
+ make kernel KSRC=/usr/src/linux \
KBUILD_OUTPUT=/usr/src/linux-obj/<arch>/<config>
where <config> is the kernel configuration to use (eg. 'smp').
-For Red Hat/Fedora and Debian distributions open-iscsi can be installed by
-typing "make install". This will copy iscsid and iscsiadm to /usr/sbin, the
-init script to /etc/init.d, and the kernel modules: iscsi_tcp.ko,
-libiscsi_tcp.ko, libiscsi.ko and scsi_transport_iscsi to
-/lib/modules/`uname -r`/kernel/drivers/scsi/ overwriting existing iscsi modules.
+To install the kernel modules that were built run:
+
+ make install_kernel
+
+This will copy: iscsi_tcp.ko, libiscsi_tcp.ko, libiscsi.ko and
+scsi_transport_iscsi to
+/lib/modules/`uname -r`/kernel/drivers/scsi/
+overwriting existing iscsi modules.
For Debian, be sure to install the linux-headers package that
corresponds to your kernel in order to compile the kernel modules
diff --git a/usr/version.h b/usr/version.h
index 797eca4..a090522 100644
--- a/usr/version.h
+++ b/usr/version.h
@@ -6,7 +6,7 @@
* This may not be the same value as the kernel versions because
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.0-872"
+#define ISCSI_VERSION_STR "2.0-873"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif
--
1.7.11.7

View File

@ -1,11 +0,0 @@
--- open-iscsi-2.0-872-rc4-bnx2i/usr/version.h 2011-09-01 20:54:51.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build/usr/version.h 2011-09-01 20:59:20.000000000 -0500
@@ -6,7 +6,7 @@
* This may not be the same value as the kernel versions because
* some other maintainer could merge a patch without going through us
*/
-#define ISCSI_VERSION_STR "2.0-873"
+#define ISCSI_VERSION_STR "6.2.0-873.2"
#define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version"
#endif

View File

@ -1,12 +0,0 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile
--- open-iscsi-2.0-872-rc4-bnx2i/usr/Makefile 2011-01-31 06:23:53.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/Makefile 2011-01-31 06:23:14.000000000 -0600
@@ -61,7 +61,7 @@ iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_
iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
iscsistart.o statics.o
- $(CC) $(CFLAGS) -static $^ -o $@
+ $(CC) $(CFLAGS) $^ -o $@
clean:
rm -f *.o $(PROGRAMS) .depend $(LIBSYS)

View File

@ -1,33 +0,0 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/include/fw_context.h open-iscsi-2.0-872-rc4-bnx2i.work/include/fw_context.h
--- open-iscsi-2.0-872-rc4-bnx2i/include/fw_context.h 2011-10-10 13:57:38.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.work/include/fw_context.h 2011-10-12 01:03:30.000000000 -0500
@@ -33,7 +34,7 @@ struct boot_context {
/* target settings */
int target_port;
char targetname[TARGET_NAME_MAXLEN + 1];
- char target_ipaddr[32];
+ char target_ipaddr[256];
char chap_name[AUTH_STR_MAX_LEN];
char chap_password[AUTH_STR_MAX_LEN];
char chap_name_in[AUTH_STR_MAX_LEN];
@@ -44,14 +45,14 @@ struct boot_context {
char initiatorname[TARGET_NAME_MAXLEN + 1];
/* network settings */
- char dhcp[18];
+ char dhcp[256];
char iface[IF_NAMESIZE];
char mac[18];
- char ipaddr[18];
- char gateway[18];
- char primary_dns[18];
- char secondary_dns[18];
- char mask[18];
+ char ipaddr[256];
+ char gateway[256];
+ char primary_dns[256];
+ char secondary_dns[256];
+ char mask[256];
char lun[17];
char vlan[15];

View File

@ -1,166 +0,0 @@
From c4331b7523afccba5176797901209a9d03afa997 Mon Sep 17 00:00:00 2001
From: Ales Kozumplik <akozumpl@redhat.com>
Date: Thu, 18 Nov 2010 17:13:36 +0100
Subject: [PATCH] libiscsi: reimplement fw discovery so partial devices are used properly.
Related: rhbz#442980
---
libiscsi/libiscsi.c | 120 ++++++++++++++++++++++++++++++--------------------
1 files changed, 72 insertions(+), 48 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index 19eae58..626e67c 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -93,6 +93,16 @@ void libiscsi_cleanup(struct libiscsi_context *context)
free(context);
}
+static void free_iface_list(struct list_head *ifaces)
+{
+ struct iface_rec *iface, *tmp_iface;
+
+ list_for_each_entry_safe(iface, tmp_iface, ifaces, list) {
+ list_del(&iface->list);
+ free(iface);
+ }
+}
+
static void free_rec_list(struct list_head *rec_list)
{
struct node_rec *rec, *tmp;
@@ -188,69 +198,83 @@ leave:
int libiscsi_discover_firmware(struct libiscsi_context *context,
int *nr_found, struct libiscsi_node **found_nodes)
{
- struct boot_context fw_entry;
- struct node_rec rec;
+ struct list_head targets, ifaces, rec_list;
+ discovery_rec_t drec;
int rc = 0;
- if (nr_found)
+ INIT_LIST_HEAD(&targets);
+ INIT_LIST_HEAD(&ifaces);
+ INIT_LIST_HEAD(&rec_list);
+
+ if (nr_found) {
*nr_found = 0;
- if (found_nodes)
+ }
+
+ if (found_nodes) {
*found_nodes = NULL;
+ }
- memset(&fw_entry, 0, sizeof fw_entry);
- rc = fw_get_entry(&fw_entry);
+ rc = fw_get_targets(&targets);
if (rc) {
- strcpy(context->error_str, "Could not read fw values.");
+ log_error("%s: Could not get list of targets from firmware "
+ "(err %d).\n", __func__, rc);
return rc;
}
- memset(&rec, 0, sizeof rec);
- idbm_node_setup_defaults(&rec);
-
- strlcpy(rec.name, fw_entry.targetname, TARGET_NAME_MAXLEN);
- rec.tpgt = 1;
- strlcpy(rec.conn[0].address, fw_entry.target_ipaddr, NI_MAXHOST);
- rec.conn[0].port = fw_entry.target_port;
-
- iface_setup_defaults(&rec.iface);
- strncpy(rec.iface.iname, fw_entry.initiatorname,
- sizeof(fw_entry.initiatorname));
- strncpy(rec.session.auth.username, fw_entry.chap_name,
- sizeof(fw_entry.chap_name));
- strncpy((char *)rec.session.auth.password, fw_entry.chap_password,
- sizeof(fw_entry.chap_password));
- strncpy(rec.session.auth.username_in, fw_entry.chap_name_in,
- sizeof(fw_entry.chap_name_in));
- strncpy((char *)rec.session.auth.password_in,
- fw_entry.chap_password_in,
- sizeof(fw_entry.chap_password_in));
- rec.session.auth.password_length =
- strlen((char *)fw_entry.chap_password);
- rec.session.auth.password_in_length =
- strlen((char *)fw_entry.chap_password_in);
-
- CHECK(idbm_add_node(&rec, NULL, 1 /* overwrite */))
+ CHECK(iface_create_ifaces_from_boot_contexts(&ifaces, &targets));
+
+ memset(&drec, 0, sizeof(drec));
+ drec.type = DISCOVERY_TYPE_FW;
+ rc = idbm_bind_ifaces_to_nodes(discovery_fw, &drec, &ifaces, &rec_list);
+ if (rc) {
+ log_error("%s: Could not determine target nodes from firmware "
+ "(err %d).\n", __func__, rc);
+ goto leave;
+ }
+
+ int node_count = 0;
+ struct list_head *pos;
+ list_for_each(pos, &rec_list) {
+ ++node_count;
+ }
- if (nr_found)
- *nr_found = 1;
+ struct libiscsi_node* new_nodes;
+ /* allocate enough space for all the nodes */
+ new_nodes = calloc(node_count, sizeof *new_nodes);
+ if (new_nodes == NULL) {
+ rc = ENOMEM;
+ log_error("%s: %s.\n", __func__, strerror(ENOMEM));
+ goto leave;
+ }
+
+ struct node_rec *rec;
+ struct libiscsi_node *new_node = new_nodes;
+ /* in one loop, add nodes to idbm and create libiscsi_node entries */
+ list_for_each_entry(rec, &rec_list, list) {
+ CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */));
+
+ strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN);
+ new_node->tpgt = rec->tpgt;
+ strlcpy(new_node->address, rec->conn[0].address, NI_MAXHOST);
+ new_node->port = rec->conn[0].port;
+
+ ++new_node;
+ }
+ /* update output parameters */
+ if (nr_found) {
+ *nr_found = node_count;
+ }
if (found_nodes) {
- *found_nodes = calloc(1, sizeof **found_nodes);
- if (*found_nodes == NULL) {
- snprintf(context->error_str,
- sizeof(context->error_str), strerror(ENOMEM));
- rc = ENOMEM;
- goto leave;
- }
- strlcpy((*found_nodes)[0].name, rec.name,
- LIBISCSI_VALUE_MAXLEN);
- (*found_nodes)[0].tpgt = rec.tpgt;
- strlcpy((*found_nodes)[0].address,
- rec.conn[0].address, NI_MAXHOST);
- (*found_nodes)[0].port = rec.conn[0].port;
+ *found_nodes = new_nodes;
}
leave:
+ fw_free_targets(&targets);
+
+ free_iface_list(&ifaces);
+ free_rec_list(&rec_list);
+
return rc;
}
--
1.7.3.2

View File

@ -1,237 +0,0 @@
From 1971024a7c6c2c2cf848aba93bd85a707875f216 Mon Sep 17 00:00:00 2001
From: Manish Rangankar <manish.rangankar@qlogic.com>
Date: Wed, 12 Oct 2011 18:57:25 +0530
Subject: [PATCH 2/2] iscsi tools: Modified libisci to support offload.
For an offload solution like qla4xxx requires to do discovery on per port
basis from application. To do that libiscsi need to be modified to take
iSCSI HW address as a input parameter and find out the current active
iface for a given port. Using this iface we can do discovery to a
given port.
Signed-off-by: Manish Rangankar <manish.rangankar@qlogic.com>
---
libiscsi/libiscsi.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++
libiscsi/libiscsi.h | 33 +++++++++++
usr/iface.c | 2 +-
3 files changed, 182 insertions(+), 1 deletions(-)
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
index dc63fcd..9b15f01 100644
--- a/libiscsi/libiscsi.c
+++ b/libiscsi/libiscsi.c
@@ -202,6 +202,154 @@ leave:
return rc;
}
+static int get_active_ifaces_form_host(struct list_head *ifaces, char *hw_addr,
+ const char *address, int *nr_iface)
+{
+ int iptype = ISCSI_IFACE_TYPE_IPV4;
+ struct iface_rec *usr_iface, *tmp_iface;
+ struct list_head t_ifaces;
+ int rc = 0;
+
+ INIT_LIST_HEAD(&t_ifaces);
+
+ iface_link_ifaces(&t_ifaces);
+ list_for_each_entry_safe(usr_iface, tmp_iface, &t_ifaces, list) {
+ (*nr_iface)++;
+ if (strcmp(usr_iface->hwaddress, hw_addr)) {
+ (*nr_iface)--;
+ list_del(&usr_iface->list);
+ free(usr_iface);
+ }
+ }
+
+ if (!strstr(address, ".") && strstr(address, ":"))
+ iptype = ISCSI_IFACE_TYPE_IPV6;
+ else if (strstr(address, ".") && !strstr(address, ":"))
+ iptype = ISCSI_IFACE_TYPE_IPV4;
+
+ list_for_each_entry_safe(usr_iface, tmp_iface, &t_ifaces, list) {
+ if (iptype == ISCSI_IFACE_TYPE_IPV4) {
+ if (strstr(usr_iface->name, "ipv4")) {
+ iface_link(ifaces, usr_iface);
+ goto exit_iface;
+ }
+ } else if (iptype == ISCSI_IFACE_TYPE_IPV6) {
+ if (strstr(usr_iface->name, "ipv6")) {
+ iface_link(ifaces, usr_iface);
+ goto exit_iface;
+ }
+ }
+ }
+
+exit_iface:
+ free_iface_list(&t_ifaces);
+ return rc;
+}
+
+int libiscsi_discover_sendtargets_by_hwaddr(struct libiscsi_context *context,
+ const char *address, int port,
+ const struct libiscsi_auth_info *auth_info, char *hw_addr,
+ int *nr_found, struct libiscsi_node **found_nodes)
+{
+ struct discovery_rec drec;
+ LIST_HEAD(bound_rec_list);
+ struct list_head *ifaces, tmp;
+ struct node_rec *rec;
+ int rc = 0, found = 0, nr_iface = 0;
+
+ INIT_LIST_HEAD(&bound_rec_list);
+ INIT_LIST_HEAD(&tmp);
+
+ if (hw_addr == NULL) {
+ strcpy(context->error_str, "Invalid argument");
+ rc = EINVAL;
+ return rc;
+ }
+
+ rc = get_active_ifaces_form_host(&tmp, hw_addr, address,
+ &nr_iface);
+ if (rc == EINVAL) {
+ strcpy(context->error_str, "Invalid argument");
+ return rc;
+ } else if (nr_iface == 0) {
+ strcpy(context->error_str, "No iface record");
+ return ENODEV;
+ }
+ ifaces = &tmp;
+
+ if (nr_found)
+ *nr_found = 0;
+ if (found_nodes)
+ *found_nodes = NULL;
+
+ CHECK(libiscsi_verify_auth_info(context, auth_info))
+
+ /* Fill the drec struct with all needed info */
+ memset(&drec, 0, sizeof drec);
+ idbm_sendtargets_defaults(&drec.u.sendtargets);
+ drec.type = DISCOVERY_TYPE_SENDTARGETS;
+ strlcpy(drec.address, address, sizeof(drec.address));
+ drec.port = port ? port : ISCSI_LISTEN_PORT;
+ switch (auth_info ? auth_info->method : libiscsi_auth_none) {
+ case libiscsi_auth_chap:
+ drec.u.sendtargets.auth.authmethod = AUTH_METHOD_CHAP;
+ strlcpy(drec.u.sendtargets.auth.username,
+ auth_info->chap.username, AUTH_STR_MAX_LEN);
+ strlcpy((char *)drec.u.sendtargets.auth.password,
+ auth_info->chap.password, AUTH_STR_MAX_LEN);
+ drec.u.sendtargets.auth.password_length =
+ strlen((char *)drec.u.sendtargets.auth.password);
+ strlcpy(drec.u.sendtargets.auth.username_in,
+ auth_info->chap.reverse_username, AUTH_STR_MAX_LEN);
+ strlcpy((char *)drec.u.sendtargets.auth.password_in,
+ auth_info->chap.reverse_password, AUTH_STR_MAX_LEN);
+ drec.u.sendtargets.auth.password_in_length =
+ strlen((char *)drec.u.sendtargets.auth.password_in);
+ break;
+ }
+
+ CHECK(idbm_add_discovery(&drec))
+ CHECK(idbm_bind_ifaces_to_nodes(discovery_sendtargets,
+ &drec, ifaces, &bound_rec_list))
+
+ /* now add/update records */
+ list_for_each_entry(rec, &bound_rec_list, list) {
+ CHECK(idbm_add_node(rec, &drec, 1 /* overwrite */))
+ found++;
+ }
+
+ if (nr_found)
+ *nr_found = found;
+
+ if (found_nodes && found) {
+ *found_nodes = calloc(found, sizeof **found_nodes);
+ if (*found_nodes == NULL) {
+ snprintf(context->error_str,
+ sizeof(context->error_str), strerror(ENOMEM));
+ rc = ENOMEM;
+ goto leave;
+ }
+ found = 0;
+ list_for_each_entry(rec, &bound_rec_list, list) {
+ strlcpy((*found_nodes)[found].name, rec->name,
+ LIBISCSI_VALUE_MAXLEN);
+ (*found_nodes)[found].tpgt = rec->tpgt;
+ strlcpy((*found_nodes)[found].address,
+ rec->conn[0].address, NI_MAXHOST);
+ (*found_nodes)[found].port = rec->conn[0].port;
+ strlcpy((*found_nodes)[found].iface,
+ rec->iface.name, LIBISCSI_VALUE_MAXLEN);
+ found++;
+ }
+ }
+
+leave:
+ free_iface_list(ifaces);
+ free_rec_list(&bound_rec_list);
+ return rc;
+}
+
+
int libiscsi_discover_firmware(struct libiscsi_context *context,
int *nr_found, struct libiscsi_node **found_nodes)
{
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h
index 61ce0ea..1d8ae7c 100644
--- a/libiscsi/libiscsi.h
+++ b/libiscsi/libiscsi.h
@@ -142,6 +142,39 @@ PUBLIC int libiscsi_discover_sendtargets(struct libiscsi_context *context,
const char *address, int port, const struct libiscsi_auth_info *auth_info,
int *nr_found, struct libiscsi_node **found_nodes);
+/** \brief Discover iSCSI nodes using sendtargets and add them to the node db.
+ *
+ * This function connects to the given address and port and then tries to
+ * discover iSCSI nodes for a given iSCSI port using the sendtargets protocol.
+ * Any found nodes are added to the local iSCSI node database and are returned
+ * in a dynamically allocated array.
+ *
+ * Note that the (optional) authentication info is for authenticating the
+ * discovery, and is not for the found nodes! If the connection(s) to the
+ * node(s) need authentication too, you can set the username / password for
+ * those (which can be different!) using the libiscsi_node_set_auth() function.
+ *
+ * \param context libiscsi context to operate on.
+ * \param address Hostname or IP-address to connect to.
+ * \param port Port to connect to, or 0 for the default port.
+ * \param auth_info Authentication information, or NULL.
+ * \param hw_addr iSCSI iface mac address.
+ * \param nr_found The number of found nodes will be returned
+ * through this pointer if not NULL.
+ * \param found_nodes The address of the dynamically allocated array
+ * of found nodes will be returned through this
+ * pointer if not NULL. The caller must free this
+ * array using free().
+ * \return 0 on success, otherwise a standard error code
+ * (from errno.h).
+ */
+PUBLIC int libiscsi_discover_sendtargets_by_hwaddr(
+ struct libiscsi_context *context,
+ const char *address, int port,
+ const struct libiscsi_auth_info *auth_info,
+ char *hw_addr, int *nr_found,
+ struct libiscsi_node **found_nodes);
+
/** \brief Read iSCSI node info from firmware and add them to the node db.
*
* This function discovers iSCSI nodes using firmware (ppc or ibft). Any found
diff --git a/usr/iface.c b/usr/iface.c
index 9431a97..1531291 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -789,7 +789,7 @@ int iface_for_each_iface(void *data, int skip_def, int *nr_found,
return err;
}
-static int iface_link(void *data, struct iface_rec *iface)
+int iface_link(void *data, struct iface_rec *iface)
{
struct list_head *ifaces = data;
struct iface_rec *iface_copy;
--
1.7.1

View File

@ -1,138 +0,0 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/README open-iscsi-2.0-872-rc4-bnx2i.work/README
--- open-iscsi-2.0-872-rc4-bnx2i/README 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/README 2011-01-31 06:36:18.000000000 -0600
@@ -403,8 +403,9 @@ this the following is not needed for sof
Warning!!!!!!
This feature is experimental. The interface may change. When reporting
bugs, if you cannot do a "ping -I ethX target_portal", then check your
-network settings first. If you cannot ping the portal, then you will
-not be able to bind a session to a NIC.
+network settings first. Make sure the rp_filter setting is set to 0 or 2
+(see Prep section below for more info). If you cannot ping the portal,
+then you will not be able to bind a session to a NIC.
What is a scsi_host and iface for software, hardware and partial
offload iscsi?
@@ -422,6 +423,32 @@ structure. For each HBA port or for soft
device (ethX) or NIC, that you wish to bind sessions to you must create
a iface config /var/lib/iscsi/ifaces.
+Prep:
+
+The iface binding feature requires the sysctl setting
+net.ipv4.conf.default.rp_filter to be set to 0 or 2. This can be set
+in /etc/sysctl.conf by having the line:
+
+net.ipv4.conf.default.rp_filter = N
+
+where N is 0 or 2. Note that when setting this you may have to reboot
+the box for the value to take effect.
+
+
+rp_filter information from Documentation/networking/ip-sysctl.txt:
+
+rp_filter - INTEGER
+ 0 - No source validation.
+ 1 - Strict mode as defined in RFC3704 Strict Reverse Path
+ Each incoming packet is tested against the FIB and if the interface
+ is not the best reverse path the packet check will fail.
+ By default failed packets are discarded.
+ 2 - Loose mode as defined in RFC3704 Loose Reverse Path
+ Each incoming packet's source address is also tested against the FIB
+ and if the source address is not reachable via any interface
+ the packet check will fail.
+
+
Running:
# iscsiadm -m iface
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/initiator.c 2011-01-31 06:23:53.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/initiator.c 2011-01-31 06:36:18.000000000 -0600
@@ -670,11 +670,11 @@ session_conn_reopen(iscsi_conn_t *conn,
static int iscsi_retry_initial_login(struct iscsi_conn *conn)
{
+ struct iscsi_session *session = conn->session;
int initial_login_retry_max;
struct timeval now, timeout, fail_time;
- initial_login_retry_max =
- conn->session->nrec.session.initial_login_retry_max;
+ initial_login_retry_max = session->nrec.session.initial_login_retry_max;
memset(&now, 0, sizeof(now));
memset(&timeout, 0, sizeof(timeout));
@@ -684,7 +684,7 @@ static int iscsi_retry_initial_login(str
if (gettimeofday(&now, NULL)) {
log_error("Could not get time of day. Dropping down to "
"max retry check.\n");
- return initial_login_retry_max > conn->session->reopen_cnt;
+ return initial_login_retry_max > session->reopen_cnt;
}
timeradd(&conn->initial_connect_time, &timeout, &fail_time);
@@ -693,9 +693,13 @@ static int iscsi_retry_initial_login(str
* then it is time to give up
*/
if (timercmp(&now, &fail_time, >)) {
- log_debug(1, "Giving up on initial login attempt after "
- "%u seconds.\n",
- initial_login_retry_max * conn->login_timeout);
+ log_error("Login timed out. Could not login to [target: %s, "
+ "portal: %s,%d] through [iface: %s].",
+ session->nrec.name,
+ session->nrec.conn[conn->id].address,
+ session->nrec.conn[conn->id].port,
+ session->nrec.iface.name);
+ iscsi_warn_on_iface_cfg(&conn->session->nrec);
return 0;
}
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.c 2011-01-31 06:36:18.000000000 -0600
@@ -259,3 +259,16 @@ int iscsi_match_session(void *data, stru
info->persistent_address,
info->persistent_port, &info->iface);
}
+
+void iscsi_warn_on_iface_cfg(struct node_rec *rec)
+{
+ if (strcmp(rec->iface.name, DEFAULT_IFACENAME) &&
+ !strcmp(rec->iface.transport_name, DEFAULT_TRANSPORT) &&
+ (iface_is_bound_by_hwaddr(&rec->iface) ||
+ iface_is_bound_by_netdev(&rec->iface)))
+ log_error("Make sure you can ping the portal with "
+ "'ping -I ethX IP', and try adjusting "
+ "net.ipv4.conf.default.rp_filter to 2 or 0 "
+ "in /etc/sysctl.conf (a reboot may be needed "
+ "after changing the sysctl settings).");
+}
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_util.h 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/iscsi_util.h 2011-01-31 06:36:18.000000000 -0600
@@ -21,4 +21,6 @@ extern int __iscsi_match_session(struct
extern char *strstrip(char *s);
extern char *cfg_get_string_param(char *pathname, const char *key);
+extern void iscsi_warn_on_iface_cfg(struct node_rec *rec);
+
#endif
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/session_mgmt.c 2011-01-31 03:10:47.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.work/usr/session_mgmt.c 2011-01-31 06:36:18.000000000 -0600
@@ -42,6 +42,13 @@ static void log_login_msg(struct node_re
rec->name, rec->conn[0].address,
rec->conn[0].port);
iscsi_err_print_msg(rc);
+
+ /*
+ * If using iface binding with tcp then warn about
+ * change in kernel behavior.
+ */
+ if (rc == ISCSI_ERR_TRANS_TIMEOUT)
+ iscsi_warn_on_iface_cfg(rec);
} else
log_info("Login to [iface: %s, target: %s, portal: "
"%s,%d] successful.", rec->iface.name,

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +0,0 @@
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c open-iscsi-2.0-872-rc4-bnx2i.test/usr/iface.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iface.c 2011-09-08 15:26:45.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.test/usr/iface.c 2011-09-08 15:31:32.000000000 -0500
@@ -829,6 +829,7 @@ int iface_setup_from_boot_context(struct
{
struct iscsi_transport *t;
uint32_t hostno;
+ int rc;
if (strlen(context->initiatorname))
strlcpy(iface->iname, context->initiatorname,
@@ -841,8 +842,6 @@ int iface_setup_from_boot_context(struct
return 0;
}
} else if (strlen(context->iface)) {
-/* this ifdef is only temp until distros and firmwares are updated */
-#ifdef OFFLOAD_BOOT_SUPPORTED
hostno = iscsi_sysfs_get_host_no_from_hwaddress(context->mac,
&rc);
if (rc) {
@@ -857,9 +856,6 @@ int iface_setup_from_boot_context(struct
}
strlcpy(iface->netdev, context->iface, sizeof(iface->netdev));
-#else
- return 0;
-#endif
} else
return 0;
diff -aurp open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c open-iscsi-2.0-872-rc4-bnx2i.test/usr/iscsi_net_util.c
--- open-iscsi-2.0-872-rc4-bnx2i/usr/iscsi_net_util.c 2011-09-08 15:27:24.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.test/usr/iscsi_net_util.c 2011-09-08 15:26:50.000000000 -0500
@@ -39,12 +39,10 @@ struct iscsi_net_driver {
};
static struct iscsi_net_driver net_drivers[] = {
-#ifdef OFFLOAD_BOOT_SUPPORTED
{"cxgb3", "cxgb3i" },
{"cxgb4", "cxgb4i" },
{"bnx2", "bnx2i" },
{"bnx2x", "bnx2i"},
-#endif
{NULL, NULL}
};

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,137 +0,0 @@
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/include/config.h open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/include/config.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/include/config.h 2011-08-14 22:58:02.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/include/config.h 2011-08-15 00:05:23.000000000 -0500
@@ -22,6 +22,7 @@
#include <netdb.h>
#include "list.h"
+#include "iscsi_net_util.h"
/* ISIDs now have a typed naming authority in them. We use an OUI */
#define DRIVER_ISID_0 0x00
@@ -31,18 +32,33 @@
/* max len of interface */
#define ISCSI_MAX_IFACE_LEN 65
-#if (ISCSID_VERSION == 872) /* 2.0-872 (RHEL 6.0) */
-
#define ISCSI_HWADDRESS_BUF_SIZE 18
#define ISCSI_TRANSPORT_NAME_MAXLEN 16
+#define ISCSI_MAX_STR_LEN 80
typedef struct iface_rec {
struct list_head list;
/* iscsi iface record name */
char name[ISCSI_MAX_IFACE_LEN];
+ uint32_t iface_num;
/* network layer iface name (eth0) */
char netdev[IFNAMSIZ];
char ipaddress[NI_MAXHOST];
+ char subnet_mask[NI_MAXHOST];
+ char gateway[NI_MAXHOST];
+ char bootproto[ISCSI_MAX_STR_LEN];
+ char ipv6_linklocal[NI_MAXHOST];
+ char ipv6_router[NI_MAXHOST];
+ char ipv6_autocfg[NI_MAXHOST];
+ char linklocal_autocfg[NI_MAXHOST];
+ char router_autocfg[NI_MAXHOST];
+ uint16_t vlan_id;
+ uint8_t vlan_priority;
+ char vlan_state[ISCSI_MAX_STR_LEN];
+ char state[ISCSI_MAX_STR_LEN]; /* 0 = disable,
+ * 1 = enable */
+ uint16_t mtu;
+ uint16_t port;
/*
* TODO: we may have to make this bigger and interconnect
* specific for infinniband
@@ -55,40 +71,6 @@ typedef struct iface_rec {
*/
char alias[TARGET_NAME_MAXLEN + 1];
char iname[TARGET_NAME_MAXLEN + 1];
-
- char vlan[ISCSI_MAX_IFACE_LEN];
-} iface_rec_t;
-
-#else /* 2.0-871 (RHEL 5.5) */
-/* number of possible connections per session */
-#define ISCSI_CONN_MAX 1
-
-#define ISCSI_TRANSPORT_NAME_MAXLEN 16
-
-typedef struct iface_rec {
- struct list_head list;
- /* iscsi iface record name */
- char name[ISCSI_MAX_IFACE_LEN];
- /* network layer iface name (eth0) */
- char netdev[IFNAMSIZ];
- char ipaddress[NI_MAXHOST];
-
- /*
- * TODO: we may have to make this bigger and interconnect
- * specific for infinniband
- */
- char hwaddress[ISCSI_MAX_IFACE_LEN];
- char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN];
- /*
- * This is only used for boot now, but the iser guys
- * can use this for their virtualization idea.
- */
- char alias[TARGET_NAME_MAXLEN + 1];
- char iname[TARGET_NAME_MAXLEN + 1];
-
- char vlan[ISCSI_MAX_IFACE_LEN];
} iface_rec_t;
-#endif /* ISCSID_VERSION */
-
#endif /* CONFIG_H */
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/include/iscsi_net_util.h open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/include/iscsi_net_util.h
--- open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/include/iscsi_net_util.h 1969-12-31 18:00:00.000000000 -0600
+++ open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/include/iscsi_net_util.h 2011-08-14 23:20:09.000000000 -0500
@@ -0,0 +1,11 @@
+#ifndef __ISCSI_NET_UTIL_h__
+#define __ISCSI_NET_UTIL_h__
+
+#define ISCSI_HWADDRESS_BUF_SIZE 18
+
+extern int net_get_transport_name_from_netdev(char *netdev, char *transport);
+extern int net_get_netdev_from_hwaddress(char *hwaddress, char *netdev);
+extern int net_setup_netdev(char *netdev, char *local_ip, char *mask,
+ char *gateway, char *remote_ip, int needs_bringup);
+
+#endif
diff -Naurp open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/src/unix/iscsid_ipc.c open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/src/unix/iscsid_ipc.c
--- open-iscsi-2.0-872-rc4-bnx2i.base/iscsiuio/src/unix/iscsid_ipc.c 2011-08-14 22:58:02.000000000 -0500
+++ open-iscsi-2.0-872-rc4-bnx2i.build2/iscsiuio/src/unix/iscsid_ipc.c 2011-08-14 23:37:00.000000000 -0500
@@ -221,18 +221,11 @@ static int parse_iface(void *arg)
data = (iscsid_uip_broadcast_t *) arg;
LOG_INFO(PFX "Received request for '%s' to set IP address: '%s' "
- "VLAN: '%s'",
+ "VLAN: '%d'",
data->u.iface_rec.rec.netdev,
- data->u.iface_rec.rec.ipaddress, data->u.iface_rec.rec.vlan);
+ data->u.iface_rec.rec.ipaddress, data->u.iface_rec.rec.vlan_id);
- vlan = atoi(data->u.iface_rec.rec.vlan);
- if ((valid_vlan(vlan) == 0) &&
- (strcmp(data->u.iface_rec.rec.vlan, "") != 0)) {
- LOG_ERR(PFX "Invalid VLAN tag: '%s'",
- data->u.iface_rec.rec.vlan)
- rc = -EIO;
- goto early_exit;
- }
+ vlan = data->u.iface_rec.rec.vlan_id;
/* Detect for CIDR notation and strip off the netmask if present */
rc = decode_cidr(data->u.iface_rec.rec.ipaddress, &ipam, &prefix_len);
@@ -590,7 +583,7 @@ int process_iscsid_broadcast(int s2)
}
/* This will be freed by parse_iface_thread() */
- data = (iscsid_uip_broadcast_t *) malloc(sizeof(*data));
+ data = (iscsid_uip_broadcast_t *) calloc(1, sizeof(*data));
if (data == NULL) {
LOG_ERR(PFX "Couldn't allocate memory for iface data");
return -ENOMEM;

View File

@ -1,12 +0,0 @@
diff -aurp 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 02:24:02.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.2005-03.org.open-iscsi";
+ prefix = "iqn.1994-05.com.redhat";
}
/* try to feed some entropy from the pool to MD5 in order to get

View File

@ -1,65 +1,70 @@
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%global _hardened_build 1
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define open_iscsi_version 2.0
%define open_iscsi_build 873
%define iscsiuio_version 0.7.2.1
Summary: iSCSI daemon and utility programs
Name: iscsi-initiator-utils
Version: 6.2.0.873
Release: 2%{?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
Version: 6.%{open_iscsi_version}.%{open_iscsi_build}
Release: 7%{?dist}
Source0: http://www.open-iscsi.org/bits/open-iscsi-%{open_iscsi_version}-%{open_iscsi_build}.tar.gz
Source1: iscsiuio-%{iscsiuio_version}.tar.gz
Source4: 04-iscsi
Source5: iscsi-tmpfiles.conf
# upstream patches, post last tagged version
Patch1: 0001-iscsid-fix-iscsid-segfault-during-qla4xxx-login.patch
Patch2: 0002-ISCSISTART-Bring-up-the-corresponding-network-interf.patch
Patch3: 0003-iscsi-tools-fix-compile-error-when-OFFLOAD_BOOT_SUPP.patch
Patch4: 0004-ISCSID-Passing-more-net-params-from-ibft-to-iface.patch
Patch5: 0005-iscsi-tools-Convert-r-argument-to-an-integer-before-.patch
Patch6: 0006-Update-README-for-removal-of-DBM-requirement.patch
Patch7: 0007-iscsid-iscsiadm-fix-abstract-socket-length-in-bind-c.patch
Patch8: 0008-iscsid-implement-systemd-compatible-socket-activatio.patch
Patch9: 0009-iscsid-add-example-unit-files-for-systemd.patch
Patch10: 0010-iscsi-tools-fix-get_random_bytes-error-handling.patch
# pending upstream merge
Patch31: 0031-iscsid-add-initrd-option-to-set-run-from-initrd-hint.patch
Patch32: 0032-iscsiadm-iscsid-newroot-command-to-survive-switch_ro.patch
Patch33: 0033-iscsiadm-param-parsing-for-advanced-node-creation.patch
Patch34: 0034-update-systemd-service-files-add-iscsi.service-for-s.patch
# distro specific modifications
Patch51: 0051-update-initscripts-and-docs.patch
Patch52: 0052-use-var-for-config.patch
Patch53: 0053-use-red-hat-for-name.patch
Patch54: 0054-add-libiscsi.patch
Patch55: 0055-dont-use-static.patch
Patch56: 0056-remove-the-offload-boot-supported-ifdef.patch
Patch57: 0057-iscsid-iscsiuio-ipc-interface.patch
Patch58: 0058-iscsiuio-IPC-newroot-command.patch
Patch59: 0059-iscsiuio-systemd-unit-files.patch
Patch60: 0060-use-systemctl-to-start-iscsid.patch
Patch61: 0061-resolve-565245-multilib-issues-caused-by-doxygen.patch
Patch62: 0062-Don-t-check-for-autostart-sessions-if-iscsi-is-not-u.patch
Patch63: 0063-fix-order-of-setting-uid-gid-and-drop-supplementary-.patch
# iscsiuio patches
Patch71: 0071-iscsiuio-0.7.4.3.patch
Patch72: 0072-iscsiuio-0.7.6.1.patch
Patch73: 0073-iscsiuio-fix-long-options.patch
Patch74: 0074-iscsiuio-add-initrd-option-to-set-run-from-initrd-hi.patch
Patch75: 0075-iscsiuio-systemd-socket-activation-support.patch
Patch76: 0076-iscsiuio-iscsid-IPC-newroot-command.patch
Patch77: 0077-iscsiuio-document-pidfile-option.patch
# version string, needs to be updated with each build
Patch99: 0099-use-Red-Hat-version-string-to-match-RPM-package-vers.patch
# sync brcm to 0.7.2.1
Patch0: iscsi-initiator-utils-sync-uio-0.7.2.1.patch
# sync iscsi tools to upstream commit 2e342633db5ac211947ffad1d8da718f6f065d3e
# (iscsi tools: update iscsi_if.h for host event)
Patch1: iscsi-initiator-utils-sync-iscsi.patch
# Add Red Hat specific info to docs.
Patch2: iscsi-initiator-utils-update-initscripts-and-docs.patch
# Upstream uses /etc/iscsi for iscsi db info, but use /var/lib/iscsi.
Patch3: iscsi-initiator-utils-use-var-for-config.patch
# Add redhat.com string to default initiator name.
Patch4: iscsi-initiator-utils-use-red-hat-for-name.patch
# Add a lib for use by anaconda.
Patch5: iscsi-initiator-utils-add-libiscsi.patch
# Add bnx2i support.
Patch6: iscsi-initiator-utils-uip-mgmt.patch
# Don't compile iscsistart as static
Patch7: iscsi-initiator-utils-dont-use-static.patch
# Remove the OFFLOAD_BOOT_SUPPORTED #ifdef.
Patch8: iscsi-initiator-utils-remove-the-offload-boot-supported-ifdef.patch
# fix ipv6 ibft/firmware boot
Patch9: iscsi-initiator-utils-fix-ipv6-boot.patch
# netconfig libiscsi support
Patch10: iscsi-initiator-utils-Add-Netconfig-support-through-libiscsi.patch
# libiscsi offload support
Patch11: iscsi-initiator-utils-libiscsi-to-support-offload.patch
# sync to upstream commit f9f627fbf0fc96545931ae65aa2b6214841bfd4e to
# add iscsiadm ping and host chap support and fix default iface handling
Patch12: iscsi-initiator-utils-ping-and-chap.patch
# sync to upstream 6676a1cf6f2d23961e9db70155b5d0e5ce511989
Patch13: iscsi-initiator-utils-mod-iface-andport-fixes.patch
# sync brcm to 0.7.4.3
Patch14: iscsi-initiator-utils-sync-uio-0.7.4.3.patch
# upstream Changelog, README and version sync for 2.0.873
Patch15: iscsi-initiator-utils-Prep-for-open-iscsi-2.0.873-release.patch
# upstream 71cd021b74a7094b5186a42bfe59a35e2fa66018
Patch16: iscsi-initiator-utils-iscsid-fix-iscsid-segfault-during-qla4xxx-login.patch
# upstream f0a8c95426d21413d9980d31740e193208e3280e
Patch17: iscsi-initiator-utils-ISCSISTART-Bring-up-the-corresponding-network-interf.patch
# sync brcm to 0.7.6.1
Patch18: iscsi-initiator-utils-sync-uio-0.7.6.1.patch
# add rhel version info to iscsi tools
Patch90: iscsi-initiator-utils-add-rh-ver.patch
Group: System Environment/Daemons
License: GPLv2+
URL: http://www.open-iscsi.org
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: flex bison python-devel doxygen kernel-headers
Requires(post): chkconfig
Requires(preun): chkconfig /sbin/service
BuildRequires: openssl-devel flex bison python-devel doxygen glibc-static kmod-devel
# For dir ownership
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%description
The iscsi package provides the server daemon for the iSCSI protocol,
@ -77,54 +82,72 @@ The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.
%prep
%setup -q -n open-iscsi-2.0-872-rc4-bnx2i
%patch0 -p1 -b .sync-uio-0.7.2.1
%patch1 -p1 -b .sync-iscsi
%patch2 -p1 -b .update-initscripts-and-docs
%patch3 -p1 -b .use-var-for-config
%patch4 -p1 -b .use-red-hat-for-name
%patch5 -p1 -b .add-libiscsi
%patch6 -p1 -b .uip-mgmt
%patch7 -p1 -b .dont-use-static
%patch8 -p1 -b .remove-the-offload-boot-supported-ifdef
%patch9 -p1 -b .fix-ipv6-boot
%patch10 -p1 -b .Add-Netconfig-support-through-libiscsi
%patch11 -p1 -b .libiscsi-to-support-offload
%patch12 -p1 -b .ping-and-chap
%patch13 -p1 -b .mod-iface-andport-fixes
%patch14 -p1 -b .sync-uio-0.7.4.3
%patch15 -p1 -b .sync-2.0.873
%patch16 -p1 -b .segfault-qla4xxx-login
%patch17 -p1 -b .boot-netif-up
%patch18 -p1 -b .sync-uio-0.7.6.1
%patch90 -p1 -b .add-rh-ver
%setup -q -n open-iscsi-%{open_iscsi_version}-%{open_iscsi_build} -a 1
mv iscsiuio-%{iscsiuio_version} iscsiuio
# upstream patches
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
# pending upstream merge
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch34 -p1
# distro specific modifications
%patch51 -p1
%patch52 -p1
%patch53 -p1
%patch54 -p1
%patch55 -p1
%patch56 -p1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
# iscsiuio patches
cd iscsiuio
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch76 -p1
%patch77 -p1
cd ..
# version string
%patch99 -p1
%build
cd utils/open-isns
./configure --with-security=no --with-slp=no
make OPTFLAGS="%{optflags}"
cd ../../
make OPTFLAGS="%{optflags}" -C utils/sysdeps
make OPTFLAGS="%{optflags}" -C utils/fwparam_ibft
make OPTFLAGS="%{optflags}" -C usr
make OPTFLAGS="%{optflags}" -C utils
make OPTFLAGS="%{optflags}" -C libiscsi
make OPTFLAGS="%{optflags} %{?__global_ldflags} -DUSE_KMOD -lkmod"
cd iscsiuio
chmod u+x configure
./configure --enable-debug
make OPTFLAGS="%{optflags}"
make OPTFLAGS="%{optflags}" LDFLAGS="%{?__global_ldflags}" CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS"
cd ..
pushd libiscsi
python setup.py build
touch -r libiscsi.doxy html/*
popd
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/sbin
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
mkdir -p $RPM_BUILD_ROOT/etc/iscsi
mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
mkdir -p $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
@ -143,18 +166,23 @@ mkdir -p $RPM_BUILD_ROOT%{python_sitearch}
install -p -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin
install -m 755 iscsiuio/src/unix/iscsiuio $RPM_BUILD_ROOT/sbin
install -p -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 etc/iscsid.conf $RPM_BUILD_ROOT%{_sysconfdir}/iscsi
install -p -m 644 doc/iscsistart.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 doc/iscsi-iname.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 iscsiuio/docs/iscsiuio.8 $RPM_BUILD_ROOT/%{_mandir}/man8
install -p -m 644 iscsiuio/iscsiuiolog $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -p -m 644 etc/iscsid.conf $RPM_BUILD_ROOT%{_sysconfdir}/iscsi
install -p -m 755 iscsiuio/src/unix/iscsiuio $RPM_BUILD_ROOT/sbin
install -p -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/iscsid
install -p -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/iscsi
install -p -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
install -p -D -m 644 etc/systemd/iscsi.service $RPM_BUILD_ROOT%{_unitdir}/iscsi.service
install -p -D -m 644 etc/systemd/iscsid.service $RPM_BUILD_ROOT%{_unitdir}/iscsid.service
install -p -D -m 644 etc/systemd/iscsid.socket $RPM_BUILD_ROOT%{_unitdir}/iscsid.socket
install -p -D -m 644 etc/systemd/iscsiuio.service $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.service
install -p -D -m 644 etc/systemd/iscsiuio.socket $RPM_BUILD_ROOT%{_unitdir}/iscsiuio.socket
install -p -D -m 755 etc/systemd/iscsi_mark_root_nodes $RPM_BUILD_ROOT/usr/libexec/iscsi_mark_root_nodes
install -p -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d
install -p -D -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d/iscsi.conf
install -p -m 755 libiscsi/libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}
ln -s libiscsi.so.0 $RPM_BUILD_ROOT%{_libdir}/libiscsi.so
@ -162,8 +190,9 @@ install -p -m 644 libiscsi/libiscsi.h $RPM_BUILD_ROOT%{_includedir}
install -p -m 755 libiscsi/build/lib.linux-*/libiscsimodule.so \
$RPM_BUILD_ROOT%{python_sitearch}
#compat support for older tools that are not aware of the name change
ln -s iscsiuio $RPM_BUILD_ROOT/sbin/brcm_iscsiuio
# for %%ghost
touch $RPM_BUILD_ROOT/var/lock/iscsi/lock
%clean
@ -172,32 +201,46 @@ rm -rf $RPM_BUILD_ROOT
%post
/sbin/ldconfig
if [ "$1" -eq "1" ]; then
%systemd_post iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
if [ $1 -eq 1 ]; then
if [ ! -f %{_sysconfdir}/iscsi/initiatorname.iscsi ]; then
echo "InitiatorName=`/sbin/iscsi-iname`" > %{_sysconfdir}/iscsi/initiatorname.iscsi
fi
/sbin/chkconfig --add iscsid
/sbin/chkconfig --add iscsi
# enable socket activation and persistant session startup by default
/bin/systemctl enable iscsi.service >/dev/null 2>&1 || :
/bin/systemctl enable iscsid.socket >/dev/null 2>&1 || :
/bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || :
fi
%postun -p /sbin/ldconfig
%preun
if [ "$1" = "0" ]; then
# stop iscsi
/sbin/service iscsi stop > /dev/null 2>&1
# delete service
/sbin/chkconfig --del iscsi
# stop iscsid
/sbin/service iscsid stop > /dev/null 2>&1
# delete service
/sbin/chkconfig --del iscsid
fi
%systemd_preun iscsi.service iscsid.service iscsiuio.service iscsid.socket iscsiuio.socket
%postun
/sbin/ldconfig
%systemd_postun
%triggerun -- iscsi-initiator-utils < 6.2.0.873-1
# Save the current service runlevel info
# User must manually run systemd-sysv-convert --apply iscsid
# and systemd-sysv-convert --apply iscsi
# to migrate them to systemd targets
/usr/bin/systemd-sysv-convert --save iscsi >/dev/null 2>&1 ||:
/usr/bin/systemd-sysv-convert --save iscsid >/dev/null 2>&1 ||:
# enable socket activation
/bin/systemctl enable iscsid.socket >/dev/null 2>&1 || :
/bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || :
# Run these because the SysV package being removed won't do them
/sbin/chkconfig --del iscsid >/dev/null 2>&1 || :
/sbin/chkconfig --del iscsi >/dev/null 2>&1 || :
/bin/systemctl try-restart iscsid.service >/dev/null 2>&1 || :
/bin/systemctl try-restart iscsi.service >/dev/null 1>&1 || :
%files
%defattr(-,root,root)
%doc README
%dir /etc/iscsi
%dir %{_var}/lib/iscsi
%dir %{_var}/lib/iscsi/nodes
%dir %{_var}/lib/iscsi/isns
@ -205,16 +248,23 @@ fi
%dir %{_var}/lib/iscsi/slp
%dir %{_var}/lib/iscsi/ifaces
%dir %{_var}/lib/iscsi/send_targets
%dir %{_var}/lock/iscsi
%{_initrddir}/iscsi
%{_initrddir}/iscsid
%{_sysconfdir}/NetworkManager
%ghost %{_var}/lock/iscsi
%ghost %{_var}/lock/iscsi/lock
%{_unitdir}/iscsi.service
%{_unitdir}/iscsid.service
%{_unitdir}/iscsid.socket
%{_unitdir}/iscsiuio.service
%{_unitdir}/iscsiuio.socket
/usr/libexec/iscsi_mark_root_nodes
%{_sysconfdir}/NetworkManager/dispatcher.d/04-iscsi
/usr/lib/tmpfiles.d/iscsi.conf
%dir %{_sysconfdir}/iscsi
%attr(0600,root,root) %config(noreplace) %{_sysconfdir}/iscsi/iscsid.conf
/sbin/*
%{_libdir}/libiscsi.so.0
%{python_sitearch}/libiscsimodule.so
%{_mandir}/man8/*
/etc/logrotate.d/iscsiuiolog
%{_sysconfdir}/logrotate.d/iscsiuiolog
%files devel
%defattr(-,root,root,-)
@ -223,176 +273,92 @@ fi
%{_includedir}/libiscsi.h
%changelog
* Mon Oct 22 2012 Chris Leech <cleech@redhat.com> - 6.2.0.873-2
- 868305 sync iscsiuio to 0.7.6.1
* Tue Jun 11 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-7
- Use the systemd tmpfiles service to recreate lockfiles in /var/lock
- 955167 build as a position independent executable
- 894576 fix order of setuid/setgid and drop additional groups
* Thu Oct 11 2012 Chris Leech <cleech@redhat.com> - 6.2.0.873-1
- Sync with upstream 2.0.873
- 854776 Bring up network interface for iSCSI boot with bnx2i
- 811428 make version string reported by iscsiadm match RPM version
- fix iscsid segfault during qla4xxx login
* Tue May 28 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-6
- Don't have iscsiadm scan for autostart record if node db is empty (bug #951951)
* Wed Oct 10 2012 Chris Leech <cleech@redhat.com> - 6.2.0.872-42
- 826300 sync iscsiuio to 0.7.4.3
* Tue Apr 30 2013 Orion Poplawski <orion@cora.nwra.com> - 6.2.0.873-5
- Fix typo in NM dispatcher script (bug #917058)
* Thu Apr 5 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.41
- 810197 Coverity fixes.
- 740054 fix iscsiuio version string
* Thu Feb 21 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-4
- build with libkmod support, instead of calling out to modprobe
- enable socket activation by default
* Wed Apr 4 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.40
- 738192 Fix regression added when handling 738192 where unknown params
messages got logged by mistake.
* Thu Jan 24 2013 Kalev Lember <kalevlember@gmail.com> - 6.2.0.873-3
- Fix the postun script to not use ldconfig as the interpreter
* Wed Mar 28 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.39
- 738192 Fix invalid param handling.
- 790609 Fix --interval iscsiadm handling.
* Wed Jan 23 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-2
- package iscsi_mark_root_nodes script, it's being referenced by the unit files
* Thu Mar 22 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.38
- Fix regressions caused by 796574 and 805467.
* Tue Jan 22 2013 Chris Leech <cleech@redhat.com> - 6.2.0.873-1
- rebase to new upstream code
- systemd conversion
- 565245 Fix multilib issues caused by timestamp in doxygen footers
* Thu Mar 22 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.37
- 805467 Have iscsistart/iscsiadm bring up offload net interface.
- 796574 Fix port handling when hostnames are used for portals.
- 739843 Fix default iface setup handling.
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.0.872-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Mar 5 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.36
- 740054 sync iscsiuio to 0.7.2.1
- 790609 Add ping and host chap support to iscsiadm
- 636013 scalability testing.
* Mon Feb 14 2012 Mike Christie <mchristi@redhat.com> 6.2.0.872.18
- 789683 Fix boot slow down when the iscsi service is started
(regression added in 6.2.0.872.16 when the nm wait was added).
* Sun Feb 26 2012 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.35
- 738192 Allow iscsistart to take any parameter.
- 739049 Fix -i use in README.
* Mon Feb 5 2012 Mike Christie <mchristi@redhat.com> 6.2.0.872.17
- 786174 Change iscsid/iscsi service startup, so it always starts
when called.
* Tue Nov 1 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.34
- 750714 Do not build with SLP.
* Sat Feb 4 2012 Mike Christie <mchristi@redhat.com> 6.2.0.872.16
- 747479 Fix iscsidevs handling of network requirement
* Tue Nov 1 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.33
- 749051 More offload boot fixups.
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.0.872-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Tue Oct 25 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.31
- 749051 Sync iscsiuio to iscsiuio-0.7.0.14g to fix boot hang
when connection is lost during startup.
* Wed Nov 30 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.14
- Fix version string to reflect fedora and not rhel.
* Tue Oct 18 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.30
- 602959 rotate iscsiuio/brcm_iscsiuio log.
* Tue Oct 18 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.13
- Update iscsi tools.
* Tue Oct 11 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.28
- 736116 (again) fix aligment for iface nl msgs.
- Fix iscsid restart issue when using qla4xxx boot.
- Fix ipv6 boot when using ibft.
* Sat Apr 30 2011 Hans de Goede <hdegoede@redhat.com> - 6.2.0.872-12
- Change iscsi init scripts to check for networking being actually up, rather
then for NetworkManager being started (#692230)
* Thu Sep 20 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.27
- 736116 Fix netlink msg len
* Tue Apr 26 2011 Hans de Goede <hdegoede@redhat.com> - 6.2.0.872-11
- Fix iscsid autostarting when upgrading from an older version
(add iscsid.startup key to iscsid.conf on upgrade)
- Fix printing of [ OK ] when successfully stopping iscsid
- systemd related fixes:
- Add Should-Start/Stop tgtd to iscsi init script to fix (re)boot from
hanging when using locally hosted targets
- %%ghost /var/lock/iscsi and contents (#656605)
* Thu Sep 8 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.26
- Fix offload removal patch
* Mon Apr 25 2011 Mike Christie <mchristi@redhat.com> 6.2.0.872-10
- Fix iscsi init scripts check for networking being up (#692230)
* Thu Sep 1 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.25
- 732912 Fix return value/msg when iscsiadm fails to log into target
- 696808 Update iscsiuio to v0.7.0.14.
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.0.872-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Aug 14 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.24
- 696808 Fix brcm_iscsiuio naming from change in 696808
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 6.2.0.872-8
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
* Sun Aug 14 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.23
- 696808 Sync brcm/uio to v0.7.0.8.
- 715434 Fix iscsiadm command line help discoverydb/discovery2 description.
* Fri Jul 12 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.7
- Sync to upstream open-iscsi-2.0-872-rc4 which fixes:
iscsiadm discovery port handling, add discoveryd init script
support, move from iscsid.conf to discovery db discoveryd settings,
and add discoverydb mode support.
* Tue Apr 19 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.21
- 593269 iscsi was built against libcrypto, but was not using the code
so this disabled the building of that code [patch from .14 got dropped
due to mismerge].
* Thu Jun 10 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.6
- Fix last patch.
* Mon Apr 18 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.20
- 696267 Create a offloaded session if the iscsi_host MAC and ibft
MAC match. This enables support for Broadcoms hba boot mode.
* Wed Jun 9 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.5
- Fix iscsiadm handling of port argument when it is not the default 3260.
* Tue Apr 5 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.19
- 624437 support hostnames in node mode. [patch merged in .14 got
dropped by accident]
* Thu Feb 24 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.18
- fix iscsiadm exit code when iscsid is not running and the
discovery command is run.
- 689359 Fix uIP when using DCB for FCoE
- 691902 Fix iscsiadm SendTargets offload support when the PDU's data len
is 8K.
* Sat Feb 19 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.17
- 634021 Fix in .14 added regression during iscsi startup that prevented
sessions from getting created.
* Wed Feb 9 2011 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.16
- 529443 fwparam_sysfs: fix pathname manipulation error in
fwparam_sysfs_boot_info.
- 529443 Make libiscsi nodes remember the interface they connect through.
* Thu Feb 3 2011 Mike Christie <mcrhsit@redhat.com> 6.2.0.872.15
- 640340 fix iscsiadm exit codes.
- 523492 iSCSI DCB support
* Mon Jan 31 2011 Mike Christie <mchristi@redhat.com> 6.2.0.872.14
- 593269 iscsi was built against libcrypto, but was not using the code
so this disabled the building of that code.
- 599539 document brcm_iscsiuio options in man page.
- 599542 document iscsiadm host mode hostno argument.
- 631821 iscsi discovery was not incrementing ITT when multiple text
commands were sent. This prevented discovery from finding all targets.
- 634021 iscsi init script did not shutdown all sessions during system
shutdown/reboot causing the host to hang.
- 658428 iscsi init script should not shutdown sessions when root is
using them and should not fail startup on all iscsiadm login failures.
- 635899 sync brcm_iscsiuio to 0.6.2.13 to add support for IPv6, VLAN,
57711E, and 57712 hardware.
- 640115 fix hang caused due to race in ISCSI_ERR_INVALID_HOST handling.
- 640340 fix iscsiadm exit codes.
- 624437 support hostnames in node mode.
* Fri Dec 3 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.13
- 442980 libiscsi: reimplement fw discovery so partial devices are used properly.
* Tue Nov 30 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.12
- 442980 partial offload boot: Remove the OFFLOAD_BOOT_SUPPORTED ifdef. This
effectively makes OFFLOAD_BOOT_SUPPORTED always enabled.
* Mon Nov 29 2010 Ales Kozumplik <akozumpl@redhat.com> 6.2.0.872.11
- 442980 brcm uio: handle the different iface_rec structures in iscsid and brcm.
* Wed Aug 18 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.10
- 605663 Log message when iface binding, and doc rp_filter settings
needed for iface binding.
p* Mon Aug 5 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.9
- 614035 Make iscsi status print session info.
- Fix uip vlan and 10 gig bugs.
* Mon Jul 26 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.8
- 589256 Re-fix iface update/delete return value.
* Mon Jul 12 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.7
- 595591 Fix nic state bug in brcm_iscsiuio.
* Thu Jul 8 2010 Mike Christie <mchristi@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@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.
* Tue May 18 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.4
- 590580 libiscsi get_firmware_foo does not work without first creating a
libiscsi context
- 588931 Fix uip and iscsid initialization race
- 570664 Add basic vlan support for bnx2i's brcm uip daemon
- 589761 Fix multiple init script bugs: rh_status does not detect offload,
start/stop does not work due to iscsiadm output being directed to stderr,
discovery daemon does not get auto started/stopped, iscsid restart does
not restart daemon if force-start was used.
- 585649 Fix iscsid "-eq: unary operator expected" bug.
* Thu May 6 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.4
- Fix iscsi script operations to check for offload drivers in rh_status
- Fix iscsiadm logging to not trigger iscsi script error detection
* Wed May 5 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.3
- 578455 Fix initial R2T=0 handling for be2iscsi
@ -407,6 +373,10 @@ p* Mon Aug 5 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.9
- 516444 Add iSNS SCN handling (rebased to open-iscsi-2.0-872-rc1-)
- Update brcm to 0.5.7
* Sun Feb 14 2010 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-13
- Preserve timestamps on doxygen generated files
- Fix FTBFS (#565038)
* Mon Feb 8 2010 Mike Christie <mchristi@redhat.com> 6.2.0.871.1.1-3
- Add spec patch comments.
@ -420,6 +390,15 @@ p* Mon Aug 5 2010 Mike Christie <mchristi@redhat.com> 6.2.0.872.9
- 529324 Add iscsi-iname and iscsistart man page
- 463582 OF/iBFT support
* Thu Jan 7 2010 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-12
- Change python_sitelib macro to use %%global as the new rpm will break
using %%define here, see:
https://www.redhat.com/archives/fedora-devel-list/2010-January/msg00093.html
* Tue Dec 1 2009 Hans de Goede <hdegoede@redhat.com> 6.2.0.870-11
- Own /etc/iscsi (#542849)
- Do not own /etc/NetworkManager/dispatcher.d (#533700)
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 6.2.0.870-10.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

2
iscsi-tmpfiles.conf Normal file
View File

@ -0,0 +1,2 @@
d /run/lock/iscsi 0700 root root -
f /run/lock/iscsi/lock 0600 root root -

View File

@ -1,190 +0,0 @@
#!/bin/sh
#
# iscsid iSCSI daemon
#
# chkconfig: 345 7 89
# description: Starts and stops the iSCSI daemon.
#
# processname: iscsid
# pidfile: /var/run/iscsid.pid
# config: /etc/iscsi/iscsid.conf
### BEGIN INIT INFO
# Provides: iscsid
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Starts and stops login iSCSI daemon.
# Description: iscsid provides the iSCSI session and connection state machine
# for software iscsi/iser (iscsi_tcp/ib_iser) and partialy
# offloaded hardware (bnx2i).
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec=/sbin/iscsid
prog=iscsid
config=/etc/iscsi/iscsid.conf
lockfile=/var/lock/subsys/$prog
iscsi_lockfile=/var/lock/subsys/iscsi
# FIXME this has a false positive for root on nfs
root_is_iscsi() {
rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
[[ "$rootopts" =~ "_netdev" ]]
}
start_iscsid() {
echo -n $"Starting $prog: "
modprobe -q iscsi_tcp
modprobe -q ib_iser
modprobe -q cxgb3i
modprobe -q cxgb4i
modprobe -q bnx2i
modprobe -q be2iscsi
daemon iscsiuio
daemon $prog
retval=$?
echo
touch $lockfile
}
force_start() {
start_iscsid
# a force start could imply the iscsi service is started due to how it
# lazy starts. We need to touch the lock file so it is shutdown later
touch $iscsi_lockfile
}
use_discoveryd() {
grep -qrs "discovery.sendtargets.use_discoveryd = Yes" /var/lib/iscsi/send_targets
if [ $? -eq 0 ] ; then
return 0
fi
grep -qrs "discovery.isns.use_discoveryd = Yes" /var/lib/iscsi/isns
if [ $? -eq 0 ] ; then
return 0
fi
return 1
}
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
# only start if nodes are setup to startup automatically, root is iscsi,
# or if iscsid is managing the sessions.
grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes
if [ $? -eq 0 ] || root_is_iscsi || use_discoveryd ; then
start_iscsid
return $?
fi
return 0
}
stop() {
if use_discoveryd ; then
iscsiadm -k 0 2>/dev/null
fi
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|cxgb3i|cxgb4i|be2iscsi") )
if [[ -n "${iparams[*]}" ]]; then
# We have active sessions, so don't stop iscsid!!
echo -n $"Not stopping $prog: iscsi sessions still active"
warning $"Not stopping $prog: iscsi sessions still active"
echo
return 0
fi
echo -n $"Stopping $prog: "
iscsiadm -k 0 2>/dev/null
echo
killproc iscsiuio
rm -f /var/run/iscsiuio.pid
# only remove the iscsi drivers when offload is used
rmmod bnx2i 2>/dev/null
rmmod cnic 2>/dev/null
rmmod cxgb3i 2>/dev/null
rmmod cxgb4i 2>/dev/null
# a bug in kobject netlink code will cause this to oops
# modprobe -r be2iscsi 2>/dev/null
modprobe -r ib_iser 2>/dev/null
modprobe -r iscsi_tcp 2>/dev/null
rm -f $lockfile
return 0
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
restart() {
rh_status_q
use_force_start=$?
stop
# if iscsid was running then make sure it starts up
if [ "$use_force_start" -eq 0 ] ; then
start_iscsid
else
start
fi
}
reload() {
return 3
}
force_reload() {
restart
}
rh_status() {
status $prog
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
force-start)
force_start
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0
{start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -1,178 +0,0 @@
#!/bin/sh
#
# iscsi: log into iSCSI targets
#
# chkconfig: 345 13 89
# description: Logs into iSCSI targets needed at system startup
# Note we should have $network in Required-Start/Stop but we don't because if
# we would require network chkconfig will put us directly after NetworkManager
# when using NM, which will make our see if the network is up test succeed
# while NM is actually still configuring the network. By not requiring network
# chkconfig will use the chkconfig header to determine our start prio, starting
# us after the old network service, but before NM (netfs does this the same).
### BEGIN INIT INFO
# Provides: iscsi
# Required-Start: iscsid
# Required-Stop: iscsid
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Starts and stops login and scanning of iSCSI devices.
# Description: iscsi provides the iSCSI state machine for software iscsi/iser
# and partial offloaded hardware. iscsi logs into and scans
# for iSCSI devices, and shuts them down when stopped.
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/sbin/iscsiadm"
prog="iscsi"
config="/etc/iscsi/initiatorname.iscsi"
lockfile=/var/lock/subsys/$prog
iscsid_lockfile=/var/lock/subsys/${prog}_iscsid
start() {
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
# if the network isn't up yet exit cleanly, NetworkManager will call us
# again when the network is up
[ ! -f /var/lock/subsys/network -a ! -f /var/lock/subsys/NetworkManager ] && exit 0
# if no nodes are setup to startup automatically exit cleanly
grep -qrs "node.startup = automatic" /var/lib/iscsi/nodes
[ $? -eq 0 ] || exit 0
# this script is normally called from startup so log into
# nodes marked node.startup=automatic
echo -n $"Starting $prog: "
$exec -m node --loginall=automatic 2>&1 > /dev/null | grep iscsiadm
# Ignore return code, because this command attempts to log into
# multiple sessions and some sessions could get logged into and
# some could be down temporarily.
success $"Starting $prog"
touch $lockfile
echo
return 0
}
iscsi_sessions_running() {
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
if [[ -z "${iparams[*]}" ]]; then
# no sessions
return 2
fi
return 0
}
cleanup_successful_stop() {
success $"Stopping $prog"
rm -f $lockfile
echo
}
stop() {
# Don't turn off iscsi if root is possibly on a iscsi disk.
rootopts=$(awk '{ if ($1 !~ /^[ \t]*#/ && $2 == "/") { print $4; }}' /etc/mtab)
if [[ "$rootopts" =~ "_netdev" ]] ; then
echo $"Can not shutdown iSCSI. Root is on a iSCSI disk."
# Just clean up lock file if this is a system shutdown/reboot.
if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
rm -f $lockfile
fi
exit 1
fi
echo -n $"Stopping $prog: "
if ! iscsi_sessions_running ; then
cleanup_successful_stop
return 0
fi
if [ "$RUNLEVEL" = "6" -o "$RUNLEVEL" = "0" -o "$RUNLEVEL" = "1" ]; then
$exec -m node --logoutall=all 2>&1 > /dev/null
else
$exec -m node --logoutall=automatic 2>&1 > /dev/null
fi
ret=$?
# ignore ISCSI_ERR_NO_OBJS_FOUND/21
if [[ "$ret" -ne 0 && "$ret" -ne 21 ]]; then
failure $"Stopping $prog"
echo
return 1
fi
cleanup_successful_stop
return 0
}
restart() {
stop
start
}
reload() {
return 3
}
force_reload() {
restart
}
rh_status() {
[ -f $lockfile ] || { echo $"$prog is stopped" ; return 3 ; }
declare -a iparams=( $(iscsiadm -m session 2>/dev/null | egrep "tcp|iser|bnx2i|be2iscsi|cxgb3i|cxgb4i") )
if [[ -z "${iparams[*]}" ]]; then
# no sessions
echo $"No active sessions"
return 2
fi
iscsiadm -m session -P 3
return 0
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0
{start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

View File

@ -1 +1,2 @@
fdc3d1fd718a6f5e4281db84c993a5e2 open-iscsi-2.0-872-rc4-bnx2i.tar.gz
8b8316d7c9469149a6cc6234478347f7 open-iscsi-2.0-873.tar.gz
22e8862a1aee0f3565b9caa4e22995f4 iscsiuio-0.7.2.1.tar.gz