[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7

Mike Christie michaelc at cs.wisc.edu
Sat Apr 7 15:44:17 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 65587dd31ca89395ee5300de33863fa880b970ce
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Thu Mar 22 02:11:42 2012 -0400

    iscsistart: fix iface overriding
    
    The user may only pass in the very basic values when overriding
    iface settings, so this patch clears out possibly conflicting
    values. For example the user may do
    
    iscsistart -b --param iface.hwaddress=$MAC
    
    but we were leaving the old netdev value in iface.net_ifacename
    if it is was in ibft/iscsi_boot.

diff --git a/usr/iscsistart.c b/usr/iscsistart.c
index 1a3b579..7eebfbf 100644
--- a/usr/iscsistart.c
+++ b/usr/iscsistart.c
@@ -40,6 +40,7 @@
 #include "log.h"
 #include "iscsi_util.h"
 #include "idbm.h"
+#include "idbm_fields.h"
 #include "version.h"
 #include "iscsi_sysfs.h"
 #include "iscsi_settings.h"
@@ -48,6 +49,7 @@
 #include "sysdeps.h"
 #include "iscsid_req.h"
 #include "iscsi_err.h"
+#include "iface.h"
 
 /* global config info */
 /* initiator needs initiator name/alias */
@@ -131,6 +133,7 @@ static int stop_event_loop(void)
 
 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 */
@@ -138,6 +141,31 @@ static int apply_params(struct node_rec *rec)
 	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;

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list