mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 03:21:44 +03:00
storage: Fix error retval for getDeviceType
On error from virAsprintf we would erroneously return 0 with the @*type not being set. Change to a return -1 on error like we should have been doing. Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b330600a69
commit
65fc17d2f6
@ -4044,8 +4044,10 @@ getDeviceType(uint32_t host,
|
||||
int retval = 0;
|
||||
|
||||
if (virAsprintf(&type_path, "/sys/bus/scsi/devices/%u:%u:%u:%u/type",
|
||||
host, bus, target, lun) < 0)
|
||||
host, bus, target, lun) < 0) {
|
||||
retval = -1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
typefile = fopen(type_path, "r");
|
||||
if (typefile == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user