tools: reduce scope of a DIR* in virHostValidateIOMMU()

This will make the trivial nature of a conversion to g_autoptr (in a
later patch) more obvious.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
Laine Stump 2020-10-25 17:56:22 -04:00
parent c40b673182
commit 59fc1e35eb

View File

@ -336,7 +336,6 @@ int virHostValidateIOMMU(const char *hvname,
bool isAMD = false, isIntel = false; bool isAMD = false, isIntel = false;
virArch arch = virArchFromHost(); virArch arch = virArchFromHost();
struct dirent *dent; struct dirent *dent;
DIR *dir;
int rc; int rc;
flags = virHostValidateGetCPUFlags(); flags = virHostValidateGetCPUFlags();
@ -375,6 +374,8 @@ int virHostValidateIOMMU(const char *hvname,
} else if (ARCH_IS_PPC64(arch)) { } else if (ARCH_IS_PPC64(arch)) {
/* Empty Block */ /* Empty Block */
} else if (ARCH_IS_S390(arch)) { } else if (ARCH_IS_S390(arch)) {
DIR *dir;
/* On s390x, we skip the IOMMU check if there are no PCI /* On s390x, we skip the IOMMU check if there are no PCI
* devices (which is quite usual on s390x). If there are * devices (which is quite usual on s390x). If there are
* no PCI devices the directory is still there but is * no PCI devices the directory is still there but is