diff --git a/src/util/virscsihost.c b/src/util/virscsihost.c index 014b96452c..32d7f2312f 100644 --- a/src/util/virscsihost.c +++ b/src/util/virscsihost.c @@ -107,11 +107,11 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, char *p = NULL; unsigned int read_unique_id; - if (!virFileIsLink(entry->d_name)) - continue; - host_link = g_strdup_printf("%s/%s", prefix, entry->d_name); + if (!virFileIsLink(host_link)) + continue; + if (virFileResolveLink(host_link, &host_path) < 0) return NULL;