From: Laine Stump Date: Sun, 25 Oct 2020 21:56:22 +0000 (-0400) Subject: tools: reduce scope of a DIR* in virHostValidateIOMMU() X-Git-Tag: v6.10.0-rc1~397 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59fc1e35eb5e1878bd8eccf959ae439311925a14;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Daniel Henrique Barboza --- diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index 9779eb7b3b..61284ae4da 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -336,7 +336,6 @@ int virHostValidateIOMMU(const char *hvname, bool isAMD = false, isIntel = false; virArch arch = virArchFromHost(); struct dirent *dent; - DIR *dir; int rc; flags = virHostValidateGetCPUFlags(); @@ -375,6 +374,8 @@ int virHostValidateIOMMU(const char *hvname, } else if (ARCH_IS_PPC64(arch)) { /* Empty Block */ } else if (ARCH_IS_S390(arch)) { + DIR *dir; + /* On s390x, we skip the IOMMU check if there are no PCI * devices (which is quite usual on s390x). If there are * no PCI devices the directory is still there but is