diff options
author | Gorka Eguileor <geguileo@redhat.com> | 2017-02-21 20:01:39 +0100 |
---|---|---|
committer | Gorka Eguileor <geguileo@redhat.com> | 2017-02-21 20:07:08 +0100 |
commit | 5e32aea95741a07d53153c658a0572588eae494d (patch) | |
tree | 3ca897de51ddcf1b8c2e5fb8211b70e94341ed1c /usr/initiator.c | |
parent | 86e88927d1ffbadff37f5d2137e5c73c50845843 (diff) | |
download | open-iscsi-5e32aea95741a07d53153c658a0572588eae494d.tar.gz |
Allow disabling auto LUN scans
Existing behavior of auto scanning LUNs is problematic for some
deployments, particularly in cases where we are:
- Accessing different LUNs from the same target on different machines
and we don't want the other LUNs automatically exposed in other
systems.
- LUNs are constantly being created and removed from the target by
another machine and we don't want our systems polluted by no longer
available logical units, since default udev rules don't remove them
automatically from the system once they have been added automatically.
This is a little more problematic when working with multipaths as we end
up with a lot of leftover device maps.
This patch introduces a new configuration option at the session level
called "scan", with "auto" and "manual" as acceptable values, that
allows us to disable the autoscan in the following cases:
- On iscsid start
- On login
- On AEN/AER messages reporting LUNs data has changed.
For HW drivers all sessions will use the value defined in the
configuration file.
Default value for this new option is "auto" to maintain existing
behavior.
Diffstat (limited to 'usr/initiator.c')
-rw-r--r-- | usr/initiator.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr/initiator.c b/usr/initiator.c index ed174b5..a86d1e6 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -997,7 +997,7 @@ static void session_scan_host(struct iscsi_session *session, int hostno, { pid_t pid; - pid = iscsi_sysfs_scan_host(hostno, 1); + pid = iscsi_sysfs_scan_host(hostno, 1, idbm_session_autoscan(session)); if (pid == 0) { mgmt_ipc_write_rsp(qtask, ISCSI_SUCCESS); @@ -1201,7 +1201,8 @@ static void iscsi_recv_async_msg(iscsi_conn_t *conn, struct iscsi_hdr *hdr) break; } - if (sshdr.asc == 0x3f && sshdr.ascq == 0x0e) + if (sshdr.asc == 0x3f && sshdr.ascq == 0x0e + && idbm_session_autoscan(session)) session_scan_host(session, session->hostno, NULL); break; case ISCSI_ASYNC_MSG_REQUEST_LOGOUT: |