diff --git a/SOURCES/0153-use-red-hat-for-name.patch b/SOURCES/0153-use-red-hat-for-name.patch index 8888200..27da7b1 100644 --- a/SOURCES/0153-use-red-hat-for-name.patch +++ b/SOURCES/0153-use-red-hat-for-name.patch @@ -1,14 +1,28 @@ -From bf7f9118ab2f1a5302dafa198d3351f6f977b7bd Mon Sep 17 00:00:00 2001 +From 7f12a1ca8fe699958903278d010cf22d0a98767b Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Mon, 19 Nov 2012 16:40:04 -0800 Subject: use red hat for name --- + doc/iscsi-iname.8 | 2 +- utils/iscsi-iname.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + 2 files changed, 2 insertions(+), 2 deletions(-) +diff --git a/doc/iscsi-iname.8 b/doc/iscsi-iname.8 +index a55d666d1af3..dd77ed9f3165 100644 +--- a/doc/iscsi-iname.8 ++++ b/doc/iscsi-iname.8 +@@ -14,7 +14,7 @@ generates a unique iSCSI node name on every invocation. + Display help + .TP + .BI [-p=]\fIprefix\fP +-Use the prefix passed in instead of the default "iqn.2005-03.org.open-iscsi" ++Use the prefix passed in instead of the default "iqn.1994-05.com.redhat" + + .SH AUTHORS + Open-iSCSI project diff --git a/utils/iscsi-iname.c b/utils/iscsi-iname.c -index 6347edc..cb2f6c8 100644 +index 6347edc46293..cb2f6c8b8651 100644 --- a/utils/iscsi-iname.c +++ b/utils/iscsi-iname.c @@ -73,7 +73,7 @@ main(int argc, char *argv[]) @@ -21,5 +35,5 @@ index 6347edc..cb2f6c8 100644 /* try to feed some entropy from the pool to MD5 in order to get -- -1.7.11.7 +2.9.5 diff --git a/SOURCES/0168-update-handling-of-boot-sessions.patch b/SOURCES/0168-update-handling-of-boot-sessions.patch index badbdb0..9c638c1 100644 --- a/SOURCES/0168-update-handling-of-boot-sessions.patch +++ b/SOURCES/0168-update-handling-of-boot-sessions.patch @@ -35,7 +35,7 @@ index 157be62..d106ac6 100644 -systemctl start iscsid.service + start_iscsid=1 + -+ if [ "$transport" = bnx2i ]; then ++ if [ "$transport" = bnx2i ] || [ "$transport" = qedi ]; then + start_iscsiuio=1 + fi +done < <( $ISCSIADM -m session ) diff --git a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch b/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch index e5c7fbc..d45b83e 100644 --- a/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch +++ b/SOURCES/0199-use-Red-Hat-version-string-to-match-RPM-package-vers.patch @@ -16,7 +16,7 @@ index 20f07946be1f..baa8c00c7185 100644 * some other maintainer could merge a patch without going through us */ -#define ISCSI_VERSION_STR "2.0-874" -+#define ISCSI_VERSION_STR "6.2.0.874-2" ++#define ISCSI_VERSION_STR "6.2.0.874-7" #define ISCSI_VERSION_FILE "/sys/module/scsi_transport_iscsi/version" #endif diff --git a/SOURCES/be2iscsi-vlan.patch b/SOURCES/be2iscsi-vlan.patch new file mode 100644 index 0000000..7a48644 --- /dev/null +++ b/SOURCES/be2iscsi-vlan.patch @@ -0,0 +1,191 @@ +commit ea9c14d9ab10d1070a8d3c032e64bb946a279a02 +Author: Chris Leech +Date: Thu Nov 30 12:05:28 2017 -0800 + + vlan setting sync for be2iscsi + +diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c +index b30518a293db..f269fc406a13 100644 +--- a/usr/iscsiadm.c ++++ b/usr/iscsiadm.c +@@ -2311,6 +2311,89 @@ static int verify_iface_params(struct list_head *params, struct node_rec *rec) + return 0; + } + ++static int iface_param_update(struct iface_rec *iface, struct list_head *params) ++{ ++ struct node_rec *rec; ++ int rc = 0; ++ ++ rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); ++ if (!rec) { ++ rc = ISCSI_ERR_INVAL; ++ goto update_fail; ++ } ++ ++ if (iscsi_check_for_running_session(rec)) ++ log_warning("Updating iface while iscsi sessions " ++ "are using it. You must logout the running " ++ "sessions then log back in for the " ++ "new settings to take affect."); ++ ++ rc = verify_iface_params(params, rec); ++ if (rc) ++ goto update_fail; ++ ++ rc = iface_conf_update(params, &rec->iface); ++ if (rc) ++ goto update_fail; ++ ++ rc = __for_each_matched_rec(0, rec, params, idbm_node_set_param); ++ if (rc == ISCSI_ERR_NO_OBJS_FOUND) ++ rc = 0; ++ else if (rc) ++ goto update_fail; ++ ++ printf("%s updated.\n", iface->name); ++ free(rec); ++ return rc; ++ ++update_fail: ++ log_error("Could not update iface %s: %s", ++ iface->name, iscsi_err_to_str(rc)); ++ free(rec); ++ return rc; ++} ++ ++struct iface_param_sync { ++ struct iface_rec *primary; ++ struct list_head *params; ++ int count; ++}; ++ ++static int update_sync_params(void *data, struct iface_rec *iface) ++{ ++ struct iface_param_sync *iface_params = data; ++ struct iface_rec *primary = iface_params->primary; ++ struct list_head *params = iface_params->params; ++ ++ if ((strcmp(primary->transport_name, iface->transport_name)) || ++ (strcmp(primary->hwaddress, iface->hwaddress)) || ++ (primary->iface_num != iface->iface_num)) ++ return 0; ++ ++ return iface_param_update(iface, params); ++} ++ ++static int split_vlan_params(struct list_head *params, struct list_head *vlan_params) ++{ ++ struct user_param *param, *tmp; ++ ++ list_for_each_entry_safe(param, tmp, params, list) { ++ if (!strncmp(param->name, "iface.vlan", 10)) { ++ list_move_tail(¶m->list, vlan_params); ++ } ++ } ++ return 0; ++} ++ ++static inline void list_splice_tail(struct list_head *list, struct list_head *head) ++{ ++ list->prev->next = head; ++ list->next->prev = head->prev; ++ head->prev->next = list->next; ++ head->prev = list->prev; ++ INIT_LIST_HEAD(list); ++} ++ + /* TODO: merge iter helpers and clean them up, so we can use them here */ + static int exec_iface_op(int op, int do_show, int info_level, + struct iface_rec *iface, uint64_t host_no, +@@ -2319,6 +2402,8 @@ static int exec_iface_op(int op, int do_show, int info_level, + struct host_info hinfo; + struct node_rec *rec = NULL; + int rc = 0; ++ LIST_HEAD(vlan_params); ++ struct iscsi_transport *t; + + switch (op) { + case OP_NEW: +@@ -2381,36 +2466,27 @@ delete_fail: + rec = idbm_create_rec(NULL, -1, NULL, -1, iface, 1); + if (!rec) { + rc = ISCSI_ERR_INVAL; +- goto update_fail; ++ break; + } +- +- if (iscsi_check_for_running_session(rec)) +- log_warning("Updating iface while iscsi sessions " +- "are using it. You must logout the running " +- "sessions then log back in for the " +- "new settings to take affect."); +- +- rc = verify_iface_params(params, rec); +- if (rc) ++ t = iscsi_sysfs_get_transport_by_name(rec->iface.transport_name); ++ if (!t) { ++ log_error("Cound not locate transport for iface %s", iface->name); ++ rc = ISCSI_ERR_INVAL; + break; +- +- /* pass rec's iface because it has the db values */ +- rc = iface_conf_update(params, &rec->iface); +- if (rc) +- goto update_fail; +- +- rc = __for_each_matched_rec(0, rec, params, +- idbm_node_set_param); +- if (rc == ISCSI_ERR_NO_OBJS_FOUND) +- rc = 0; +- else if (rc) +- goto update_fail; +- +- printf("%s updated.\n", iface->name); +- break; +-update_fail: +- log_error("Could not update iface %s: %s", +- iface->name, iscsi_err_to_str(rc)); ++ } ++ if (t->template->sync_vlan_settings) { ++ /* sync shared vlan settings across ifaces */ ++ int nr_found = 0; ++ struct iface_param_sync sync_params = { ++ .primary = &rec->iface, ++ .params = &vlan_params, ++ .count = 0, ++ }; ++ split_vlan_params(params, &vlan_params); ++ iface_for_each_iface(&sync_params, 1, &nr_found, update_sync_params); ++ } ++ iface_param_update(&rec->iface, params); ++ list_splice_tail(&vlan_params, params); + break; + case OP_APPLY: + if (!iface) { +diff --git a/usr/transport.c b/usr/transport.c +index 3b7a00a2245e..35a8ccd4a400 100644 +--- a/usr/transport.c ++++ b/usr/transport.c +@@ -91,6 +91,7 @@ struct iscsi_transport_template bnx2i = { + struct iscsi_transport_template be2iscsi = { + .name = "be2iscsi", + .bind_ep_required = 1, ++ .sync_vlan_settings = 1, + .create_conn = be2iscsi_create_conn, + .ep_connect = ktransport_ep_connect, + .ep_poll = ktransport_ep_poll, +diff --git a/usr/transport.h b/usr/transport.h +index b67776b47288..07027564e46b 100644 +--- a/usr/transport.h ++++ b/usr/transport.h +@@ -40,6 +40,9 @@ struct iscsi_transport_template { + uint8_t use_boot_info; + uint8_t bind_ep_required; + uint8_t no_netdev; ++ /* be2iscsi has a single host vlan setting, ++ * but uses 2 ifaces for ipv4 and ipv6 settings; keep them in sync */ ++ uint8_t sync_vlan_settings; + int (*ep_connect) (struct iscsi_conn *conn, int non_blocking); + int (*ep_poll) (struct iscsi_conn *conn, int timeout_ms); + void (*ep_disconnect) (struct iscsi_conn *conn); diff --git a/SPECS/iscsi-initiator-utils.spec b/SPECS/iscsi-initiator-utils.spec index e164c03..a7bd696 100644 --- a/SPECS/iscsi-initiator-utils.spec +++ b/SPECS/iscsi-initiator-utils.spec @@ -4,7 +4,7 @@ Summary: iSCSI daemon and utility programs Name: iscsi-initiator-utils Version: 6.%{open_iscsi_version}.%{open_iscsi_build} -Release: 4%{?dist} +Release: 7%{?dist} Group: System Environment/Daemons License: GPLv2+ URL: http://www.open-iscsi.org @@ -48,6 +48,7 @@ Patch168: 0168-update-handling-of-boot-sessions.patch Patch169: 0169-update-iscsi.service-for-boot-session-recovery.patch Patch170: 0170-fix-systemd-unit-wants.patch Patch172: 0172-move-cleanup-to-seperate-service.patch +Patch175: be2iscsi-vlan.patch # upstream removed internal open-isns, but not taking that here just yet # it requires repackaging isns-utils to provide a debug package Patch198: keep-open-isns.patch @@ -180,6 +181,7 @@ if [ $1 -eq 1 ]; then # 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 start iscsid.socket >/dev/null 2>&1 || : fi %post iscsiuio @@ -187,6 +189,7 @@ fi if [ $1 -eq 1 ]; then /bin/systemctl enable iscsiuio.socket >/dev/null 2>&1 || : + /bin/systemctl start iscsiuio.socket >/dev/null 2>&1 || : fi %preun @@ -271,6 +274,17 @@ fi %{_includedir}/libiscsi.h %changelog +* Thu Nov 30 2017 Chris Leech - 6.2.0.874-7 +- 1328694 keep vlan settings in sync for ipv4/ipv6 iface records with be2iscsi + +* Wed Nov 01 2017 Chris Leech - 6.2.0.874-6 +- 1507945 force start iscsiuio for boot session recovery with qedi +- 1457359 start systemd socket listeners, otherwise if iscsid is started + directly iscsiuio doesn't activate as expected + +* Tue Aug 15 2017 Chris Leech - 6.2.0.874-5 +- 1431622 fix default in iscsi-iname manpage to match Red Hat customization + * Tue Jun 27 2017 Chris Leech - 6.2.0.874-4 - 1450756 isolate iscsistart sockets