提交 850cfd75 编写于 作者: J John Ferlan

storage: Fetch a unique key for vHBA/NPIV LUNs

https://bugzilla.redhat.com/show_bug.cgi?id=1657468

Commit be1bb6c9 changed the way volumes were stored from a forward
linked list to a hash table. In doing so, it required that each vol
object would have 3 unique values as keys into tables - key, name,
and path. Due to how vHBA/NPIV LUNs are created/used this resulted
in a failure to utilize all the LUN's found during processing.

During virStorageBackendSCSINewLun processing fetch the key (or
serial value) for NPIV LUN's using virStorageFileGetNPIVKey which
will formulate a more unique key based on the serial value and
the port for the LUN.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
ACKed-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 5f9e211c
...@@ -3776,12 +3776,16 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool) ...@@ -3776,12 +3776,16 @@ virStorageBackendRefreshLocal(virStoragePoolObjPtr pool)
static char * static char *
virStorageBackendSCSISerial(const char *dev) virStorageBackendSCSISerial(const char *dev,
bool isNPIV)
{ {
int rc; int rc;
char *serial = NULL; char *serial = NULL;
rc = virStorageFileGetSCSIKey(dev, &serial, true); if (isNPIV)
rc = virStorageFileGetNPIVKey(dev, &serial);
else
rc = virStorageFileGetSCSIKey(dev, &serial, true);
if (rc == 0 && serial) if (rc == 0 && serial)
return serial; return serial;
...@@ -3878,7 +3882,10 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool, ...@@ -3878,7 +3882,10 @@ virStorageBackendSCSINewLun(virStoragePoolObjPtr pool,
VIR_STORAGE_VOL_READ_NOERROR)) < 0) VIR_STORAGE_VOL_READ_NOERROR)) < 0)
goto cleanup; goto cleanup;
if (!(vol->key = virStorageBackendSCSISerial(vol->target.path))) vol->key = virStorageBackendSCSISerial(vol->target.path,
(def->source.adapter.type ==
VIR_STORAGE_ADAPTER_TYPE_FC_HOST));
if (!vol->key)
goto cleanup; goto cleanup;
def->capacity += vol->target.capacity; def->capacity += vol->target.capacity;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册