feat: read and validate unit serial number after login

this patch adds a read of VPD page 0x80 (unit serial number) after successful login.

The serial is then validated on secutive reconnects to avoid the accidental mismatch
of LUN ids if some kind of remapping appears between loss of connection and a later
reconnect.

An additional url parameter force_usn is added to enforce the usn right from the beginning.
If not set via url or the new iscsi_set_unit_serial_number function the usn is learned
at the first successful login.

Signed-off-by: Peter Lieven <pl@dlhnet.de>
This commit is contained in:
Peter Lieven
2025-09-11 15:15:42 +00:00
parent 9b1a625adc
commit 8c4e2ad46b
5 changed files with 128 additions and 20 deletions

View File

@@ -48,10 +48,11 @@ target_password=<password>
header_digest=<crc32c|none>
data_digest=<crc32c|none>
auth=<md5|sha1|sha-256|sha3-256>
force_usn=<unit_serial_number>
Transport:
iser
Example:
iscsi://server/iqn.ronnie.test/1
@@ -193,7 +194,7 @@ To run those tests you would specify
Test discovery
--------------
To discover which tests exist you can use the command
To discover which tests exist you can use the command
iscsi-test-cu --list
Examples