mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
esxStorageVolGetXMLDesc: Lookup SCSI lun properly
So the idea is as follows: firstly we obtain a list of all the luns, then iterate over it trying to find the one we want to work with and after all the iterations we detect whether we have found something. Now, the last check is broken, because it compares a value form previous iteration, not the one we've just been through. Then, when computing md5 sum of lun's UUID, we use wrong variable again. Well, @hostScsiDisk which is type of esxVI_HostScsiDisk extends esxVI_ScsiLun type so they both have the uuid member, but it just doesn't feel right to access the data via two different variables in one function call. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c94720f86a
commit
99809fd482
@ -687,7 +687,7 @@ esxStorageVolGetXMLDesc(virStorageVolPtr volume,
|
||||
}
|
||||
}
|
||||
|
||||
if (!hostScsiDisk) {
|
||||
if (!scsiLun) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Could find volume with name: %s"), volume->name);
|
||||
goto cleanup;
|
||||
@ -697,7 +697,7 @@ esxStorageVolGetXMLDesc(virStorageVolPtr volume,
|
||||
|
||||
def.name = volume->name;
|
||||
|
||||
md5_buffer(scsiLun->uuid, strlen(hostScsiDisk->uuid), md5);
|
||||
md5_buffer(scsiLun->uuid, strlen(scsiLun->uuid), md5);
|
||||
|
||||
virUUIDFormat(md5, uuid_string);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user