[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:02 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 2e342633db5ac211947ffad1d8da718f6f065d3e
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Mon Mar 5 16:46:07 2012 -0600

    iscsi tools: update iscsi_if.h for host event
    
    Patch from: Vikas Chaudhary <vikas.chaudhary at qlogic.com>
    
    [added code to print link up/down message by Mike Christie]
    Signed-off-by: Vikas Chaudhary <vikas.chaudhary at qlogic.com>

diff --git a/include/iscsi_if.h b/include/iscsi_if.h
index 28447df..540cd8d 100644
--- a/include/iscsi_if.h
+++ b/include/iscsi_if.h
@@ -79,8 +79,9 @@ enum iscsi_uevent_e {
 	ISCSI_KEVENT_PATH_REQ		= KEVENT_BASE + 7,
 	ISCSI_KEVENT_IF_DOWN		= KEVENT_BASE + 8,
 	ISCSI_KEVENT_CONN_LOGIN_STATE   = KEVENT_BASE + 9,
+	ISCSI_KEVENT_HOST_EVENT		= KEVENT_BASE + 10,
 
-	ISCSI_KEVENT_MAX		= ISCSI_KEVENT_CONN_LOGIN_STATE,
+	ISCSI_KEVENT_MAX		= ISCSI_KEVENT_HOST_EVENT,
 };
 
 enum iscsi_tgt_dscvr {
@@ -89,6 +90,13 @@ enum iscsi_tgt_dscvr {
 	ISCSI_TGT_DSCVR_SLP		= 3,
 };
 
+enum iscsi_host_event_code {
+	ISCSI_EVENT_LINKUP		= 1,
+	ISCSI_EVENT_LINKDOWN,
+	/* must always be last */
+	ISCSI_EVENT_MAX,
+};
+
 struct iscsi_uevent {
 	uint32_t type; /* k/u events type */
 	uint32_t iferror; /* carries interface or resource errors */
@@ -231,6 +239,11 @@ struct iscsi_uevent {
 		struct msg_notify_if_down {
 			uint32_t	host_no;
 		} notify_if_down;
+		struct msg_host_event {
+			uint32_t	host_no;
+			uint32_t	data_size;
+			enum iscsi_host_event_code code;
+		} host_event;
 	} r;
 } __attribute__ ((aligned (sizeof(uint64_t))));
 
diff --git a/usr/netlink.c b/usr/netlink.c
index 08c08d8..0e842b5 100644
--- a/usr/netlink.c
+++ b/usr/netlink.c
@@ -1088,6 +1088,24 @@ static int ctldev_handle(void)
 		/* session wide event so cid is 0 */
 		cid = 0;
 		break;
+	case ISCSI_KEVENT_HOST_EVENT:
+		switch (ev->r.host_event.code) {
+		case ISCSI_EVENT_LINKUP:
+			log_warning("Host%u: Link Up.\n",
+				    ev->r.host_event.host_no);
+			break;
+		case ISCSI_EVENT_LINKDOWN:
+			log_warning("Host%u: Link Down.\n",
+				    ev->r.host_event.host_no);
+			break;
+		default:
+			log_debug(7, "Host%u: Unknwon host event: %u.\n",
+				  ev->r.host_event.host_no,
+				  ev->r.host_event.code);
+		}
+
+		drop_data(nlh);
+		return 0;
 	default:
 		if ((ev->type > ISCSI_UEVENT_MAX && ev->type < KEVENT_BASE) ||
 		    (ev->type > ISCSI_KEVENT_MAX))

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list