Inside of virSCSIHostFindByPCI() there're some variables that are
used from a while() loop exclusively. Bring their declaration
into the loop.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SCSI_HOST_PATH;
struct dirent *entry = NULL;
g_autoptr(DIR) dir = NULL;
- char *p = NULL;
char *ret = NULL;
- unsigned int read_unique_id;
if (virDirOpen(&dir, prefix) < 0)
return NULL;
g_autofree char *host_path = NULL;
g_autofree char *unique_path = NULL;
g_autofree char *buf = NULL;
+ char *p = NULL;
+ unsigned int read_unique_id;
if (!virFileIsLink(entry->d_name))
continue;