John Ferlan
5f9e211c93
util: Introduce virStorageFileGetNPIVKey
...
The vHBA/NPIV LUNs created via the udev processing of the
VPORT_CREATE command end up using the same serial value
as seen/generated by the /lib/udev/scsi_id as returned
during virStorageFileGetSCSIKey. Therefore, in order to
generate a unique enough key to be used when adding the
LUN as a volume during virStoragePoolObjAddVol a more
unique key needs to be generated for an NPIV volume.
The problem is illustrated by the following example, where
scsi_host5 is a vHBA used with the following LUNs:
$ lsscsi -tg
...
[5:0:4:0] disk fc:0x5006016844602198,0x101f00 /dev/sdh /dev/sg23
[5:0:5:0] disk fc:0x5006016044602198,0x102000 /dev/sdi /dev/sg24
...
Calling virStorageFileGetSCSIKey would return:
/lib/udev/scsi_id --device /dev/sdh --whitelisted --replace-whitespace /dev/sdh
350060160c460219850060160c4602198
/lib/udev/scsi_id --device /dev/sdh --whitelisted --replace-whitespace /dev/sdi
350060160c460219850060160c4602198
Note that althrough /dev/sdh and /dev/sdi are separate LUNs, they
end up with the same serial number used for the vol->key value.
When virStoragePoolFCRefreshThread calls virStoragePoolObjAddVol
the second LUN fails to be added with the following message
getting logged:
virHashAddOrUpdateEntry:341 : internal error: Duplicate key
To resolve this, virStorageFileGetNPIVKey will use a similar call
sequence as virStorageFileGetSCSIKey, except that it will add the
"--export" option to the call. This results in more detailed output
which needs to be parsed in order to formulate a unique enough key
to be used. In order to be unique enough, the returned value will
concatenate the target port as returned in the "ID_TARGET_PORT"
field from the command to the "ID_SERIAL" value.
Signed-off-by: John Ferlan <jferlan@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2019-02-01 10:38:59 -05:00
..
2018-12-13 16:08:38 +00:00
2018-12-14 13:54:50 +01:00
2018-12-05 10:39:54 +01:00
2018-12-14 10:47:13 +00:00
2018-08-24 13:23:36 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-09-20 10:16:38 +02:00
2018-12-14 10:47:13 +00:00
2018-09-20 10:16:39 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-01-03 13:24:18 +01:00
2019-01-03 13:24:18 +01:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-17 15:02:11 +00:00
2018-12-17 15:02:11 +00:00
2018-12-14 10:47:13 +00:00
2019-01-03 13:24:18 +01:00
2019-01-03 13:24:18 +01:00
2018-12-05 10:39:54 +01:00
2018-12-14 10:47:13 +00:00
2019-01-28 14:46:58 +01:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-17 17:47:30 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 13:54:50 +01:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-07-23 14:27:30 +02:00
2018-12-14 10:47:13 +00:00
2019-01-28 14:56:21 +01:00
2019-01-28 14:56:21 +01:00
2018-09-20 13:45:56 -04:00
2018-12-14 10:47:13 +00:00
2019-01-29 13:35:58 +00:00
2019-01-29 13:35:58 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-09-20 10:16:38 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2017-06-12 19:11:30 -04:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2019-01-23 10:21:35 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-01-29 13:37:11 +00:00
2019-01-29 13:37:11 +00:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2019-01-25 09:21:24 -06:00
2019-01-25 09:21:24 -06:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-07-27 17:21:25 +02:00
2018-12-14 10:47:13 +00:00
2018-07-27 17:21:25 +02:00
2018-12-14 10:47:13 +00:00
2018-11-16 13:42:39 +01:00
2018-12-14 10:47:13 +00:00
2019-01-08 10:01:54 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-10-29 12:45:54 -04:00
2018-12-14 10:47:13 +00:00
2018-12-05 10:39:54 +01:00
2018-12-14 10:47:13 +00:00
2019-01-24 10:02:31 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-01-15 13:00:52 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2019-01-10 12:35:43 -05:00
2018-12-14 10:47:13 +00:00
2018-08-07 16:29:56 +02:00
2018-12-14 10:47:13 +00:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2019-01-24 10:11:27 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-08-07 16:29:56 +02:00
2018-12-14 10:47:13 +00:00
2018-03-14 12:46:26 +01:00
2018-12-14 10:47:13 +00:00
2019-01-25 14:50:05 +01:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-11-16 13:42:38 +01:00
2018-12-14 10:47:13 +00:00
2018-09-24 10:02:40 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2019-01-28 14:46:58 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2017-09-21 15:46:48 -04:00
2018-12-14 10:47:13 +00:00
2018-09-20 10:16:39 +02:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-02-01 10:38:59 -05:00
2019-02-01 10:38:59 -05:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2017-12-05 11:28:19 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2019-01-03 13:24:18 +01:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-07-23 14:28:58 -04:00
2018-12-14 10:47:13 +00:00
2018-11-14 17:09:41 +00:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2019-02-01 12:44:28 +01:00
2018-12-14 10:47:13 +00:00
2018-12-13 16:08:38 +00:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2018-05-29 15:42:03 +02:00
2018-12-14 10:47:13 +00:00
2018-12-14 10:47:13 +00:00
2019-01-03 13:24:18 +01:00
2019-01-03 13:24:18 +01:00