From nobody Mon Feb 9 12:11:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.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 170.10.133.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=1639052570; cv=none; d=zohomail.com; s=zohoarc; b=W2gaQaCrIcB271ioKhpo+Wr/5YIpU71AUO2F+dPiWw2qcyO3tilI65OwNWkEyVK/7PZKwFfNH4PoQkhssF2z/12vufMb5oFunv59tZjvARX515C+Ig14+LYXmsFG/BnfNna+gHrPLPmPf7QIWCcDHxxkBIrjbd2RfLgdt6f1T+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639052570; 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=mE+aR068QDHG5bh5NVbTjfJ9J9WSanxTqO0V1UBvmww=; b=gvUTLLuJwbwlv1KZFnkoIVLDomD9bYT8+FKPIGKYze2K6v9Dmb3n6lnI3q7OEMAMKaEW2qjNTNDvuWy+kwnNkpbOJrd9h8jxeoL8d7GLKDoZN3DQgUnBWtGpfofw8+X3AeRUEQj++uc3btM2ECpk1SNbaDe8aHRiqyGhD6a5yyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1639052570249628.2305463518745; Thu, 9 Dec 2021 04:22:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-386-Vj4rOMhwM9CdbczJwDePcg-1; Thu, 09 Dec 2021 07:22:45 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AD77581CCC7; Thu, 9 Dec 2021 12:22:40 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71E555D6D5; Thu, 9 Dec 2021 12:22:40 +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 35FBA1802E38; Thu, 9 Dec 2021 12:22:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 1B9CMXrO015750 for ; Thu, 9 Dec 2021 07:22:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id E2BAB17DBA; Thu, 9 Dec 2021 12:22:33 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CE3217CD9 for ; Thu, 9 Dec 2021 12:22:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639052569; 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=mE+aR068QDHG5bh5NVbTjfJ9J9WSanxTqO0V1UBvmww=; b=IB+pZ/nh/32fSq9AF8aJmD3XrBRolrmz5aqsrbbMPuD7XxMo6rzTLB4v6VtUpUaRxjx7CL osZB1M/OFfRdjLGUDf5kuXflC4PoEYCVgiPkr3lR12t1sn0g+1ODtjMCKxp0zayeA1sjN1 hdGAOtgWgR/Fyvp6NVzmwz1GDiC7dkg= X-MC-Unique: Vj4rOMhwM9CdbczJwDePcg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 34/36] virt-host-validate-common: Use automatic memory freeing for virBitmap Date: Thu, 9 Dec 2021 13:18:39 +0100 Message-Id: <6e4d615a7a2d865e3ba8476c132559d68a3d80a7.1639052248.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.15 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) X-ZM-MESSAGEID: 1639052572280100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tools/virt-host-validate-common.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index aba1bdf6cf..647ed7b48b 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -330,7 +330,7 @@ int virHostValidateCGroupControllers(const char *hvname= G_GNUC_UNUSED, int virHostValidateIOMMU(const char *hvname, virHostValidateLevel level) { - virBitmap *flags; + g_autoptr(virBitmap) flags =3D NULL; struct stat sb; const char *bootarg =3D NULL; bool isAMD =3D false, isIntel =3D false; @@ -347,8 +347,6 @@ int virHostValidateIOMMU(const char *hvname, else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_= SVM)) isAMD =3D true; - virBitmapFree(flags); - if (isIntel) { if (access("/sys/firmware/acpi/tables/DMAR", F_OK) =3D=3D 0) { virHostMsgPass(); @@ -445,7 +443,7 @@ bool virHostKernelModuleIsLoaded(const char *module) int virHostValidateSecureGuests(const char *hvname, virHostValidateLevel level) { - virBitmap *flags; + g_autoptr(virBitmap) flags =3D NULL; bool hasFac158 =3D false; bool hasAMDSev =3D false; virArch arch =3D virArchFromHost(); @@ -460,8 +458,6 @@ int virHostValidateSecureGuests(const char *hvname, else if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_= SEV)) hasAMDSev =3D true; - virBitmapFree(flags); - virHostMsgCheck(hvname, "%s", _("for secure guest support")); if (ARCH_IS_S390(arch)) { if (hasFac158) { --=20 2.31.1