]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virSCSIHostFindByPCI: Fix link detection
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Mar 2023 07:42:19 +0000 (08:42 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Mar 2023 11:10:03 +0000 (12:10 +0100)
commite8a83aab5d312df01c4d669569d0472d0ee8a261
tree0950a71b33b1d13fc7d3bf3b03f05f4e034a6059
parent20a719dce6480e7369eab357326281b3437505b6
virSCSIHostFindByPCI: Fix link detection

Inside of virSCSIHostFindByPCI() there's a loop which iterates of
entries of "/sys/class/scsi_host" directory trying to identify
all symlinks (which then point to a SCSI device, but that's not
important right now). But the way virFileIsLink() is called can
never return a truthful reply - because it's called over
dent->d_name instead of full path. Fix this by moving the
virFileIsLink() call and passing constructed path into it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virscsihost.c