From nobody Mon Feb 9 10:47:50 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603848981; cv=none; d=zohomail.com; s=zohoarc; b=KZkLpxqxmGai+VRcf/E/1J9dT7ACJ4tG5ZPxkWTH43baBYMSCAiS4VJiRHHAOU9QymgUjG6HfwVAWj0qXZRDkXEg72glO7hCDweGezWKQwoGmbtvxxhFIRauyFdUP3gpgtwdcFYlIj3HLffbzM9UcVjxKbp3rCithL874ub9K9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603848981; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LKRLFjg6HjWIeMICvQ+MzoJ4lbvMhgtDqCD1amZQMCw=; b=c15oPVp89Joc/0PhiLKHeieGfazzxfliu5vzkambIkbY86DCVcQjvWdSsd+krdPqGsQ8UrB/kFcccf9Xrhwj8T03lUny2JqwtbtWxtR5JO18oS/zKIelKUPemOePIMSMZM0kEr4sBH9ScNyfW85mh5qRfkFQvaEFPrqM9DCXKxU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603848981510264.43184227602535; Tue, 27 Oct 2020 18:36:21 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-LzqSwDdzOsixBFRPTTT0SA-1; Tue, 27 Oct 2020 21:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDEF364A75; Wed, 28 Oct 2020 01:36:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0BC76EF71; Wed, 28 Oct 2020 01:36:11 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id B4C5458103; Wed, 28 Oct 2020 01:36:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09S1a7jF028231 for ; Tue, 27 Oct 2020 21:36:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 244AF5C22B; Wed, 28 Oct 2020 01:36:07 +0000 (UTC) Received: from vhost2.laine.org (ovpn-113-144.phx2.redhat.com [10.3.113.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id DB1F55C22A for ; Wed, 28 Oct 2020 01:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603848980; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=LKRLFjg6HjWIeMICvQ+MzoJ4lbvMhgtDqCD1amZQMCw=; b=SSjD2FDHj5CvnMGdbOedUyGCItSAHgZMiki/K5GfX56HF+aR9gzzo8BrTmInVORi0+F/Wb Az8y6CvZR9H5yT8mG0L1Cx8tLw4HeqD8mTgrh8b5Hm/xMuAqFq9hkbdHhp+1uNSlMMNZc5 mWgy5SM9u72KRN0vP54j9fePgUwnqsk= X-MC-Unique: LzqSwDdzOsixBFRPTTT0SA-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 02/12] tools: reduce scope of a DIR* in virHostValidateIOMMU() Date: Tue, 27 Oct 2020 21:35:48 -0400 Message-Id: <20201028013558.424925-3-laine@redhat.com> In-Reply-To: <20201028013558.424925-1-laine@redhat.com> References: <20201028013558.424925-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This will make the trivial nature of a conversion to g_autoptr (in a later patch) more obvious. Signed-off-by: Laine Stump --- tools/virt-host-validate-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.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 =3D false, isIntel =3D false; virArch arch =3D virArchFromHost(); struct dirent *dent; - DIR *dir; int rc; =20 flags =3D 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 --=20 2.26.2