mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 21:34:54 +03:00
virscsi: hostdev SCSI AdapterId retrieval fix
Fixed the retrieval of the AdapterId from the AdapterName of the hostdev source so it does return an error instead of leaving the adapter_id uninitialized. Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com> Reviewed-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
0c500a4f2e
commit
11d9dd7ba0
@ -88,16 +88,13 @@ static int
|
||||
virSCSIDeviceGetAdapterId(const char *adapter,
|
||||
unsigned int *adapter_id)
|
||||
{
|
||||
if (STRPREFIX(adapter, "scsi_host")) {
|
||||
if (virStrToLong_ui(adapter + strlen("scsi_host"),
|
||||
NULL, 0, adapter_id) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Cannot parse adapter '%s'"), adapter);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (STRPREFIX(adapter, "scsi_host") &&
|
||||
virStrToLong_ui(adapter + strlen("scsi_host"),
|
||||
NULL, 0, adapter_id) == 0)
|
||||
return 0;
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Cannot parse adapter '%s'"), adapter);
|
||||
return -1;
|
||||
}
|
||||
|
||||
char *
|
||||
|
Loading…
Reference in New Issue
Block a user