]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tools: reduce scope of a DIR* in virHostValidateIOMMU()
authorLaine Stump <laine@redhat.com>
Sun, 25 Oct 2020 21:56:22 +0000 (17:56 -0400)
committerLaine Stump <laine@redhat.com>
Tue, 3 Nov 2020 03:01:36 +0000 (22:01 -0500)
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>
tools/virt-host-validate-common.c

index 9779eb7b3b7bc5866d1b68e9b20bd156da1e285e..61284ae4da825c283e026fe224c5f46106c6dc39 100644 (file)
@@ -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