From nobody Tue Feb 10 01:15:31 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=1671714188; cv=none; d=zohomail.com; s=zohoarc; b=Li/bhn3TccQ0oNx44ITdKIxj3haE9y+n+9pqQRyYYeGvQzyfwlbBLacrTbxQO1zB/umiohh+dOXo2MatABxjjnFXHbk8jhtYmbtLYybWEn6eFPX31XtMBdFj7w+ceuVWPPq1GOUlS7jgj8secF5qqmFzbVlcSZBrY1l9Q07LPuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671714188; 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=uOFO1yVQ8yUMMUCML2/LqPjIDlF1ACiNNtVWIVPM80k=; b=H+6+zSX7EUeStP4uRWEL1m74kaYsjoAxrJHUOcOkuuq3SCo5qe4mVHkYDXAK1sczjveZFuQQ5x06cTctubozEGm654wntDv45mr0cypROykoe47FvCsuuVwKoNaAEmj5u/sMyNIjIRaU9SBNTGY7uiwKQqqf6jNVPSKDmONmELI= 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 1671714188104457.2064838365584; Thu, 22 Dec 2022 05:03:08 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-267-E289zV1DPlGdgS2_6yQUFQ-1; Thu, 22 Dec 2022 08:01:52 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57E9F3C10176; Thu, 22 Dec 2022 13:01:48 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E396840C1073; Thu, 22 Dec 2022 13:01:47 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A9B8919465B2; Thu, 22 Dec 2022 13:01:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B029D1946A6B for ; Thu, 22 Dec 2022 13:01:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A28DC40C2004; Thu, 22 Dec 2022 13:01:46 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A46340C2064 for ; Thu, 22 Dec 2022 13:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671714187; 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=uOFO1yVQ8yUMMUCML2/LqPjIDlF1ACiNNtVWIVPM80k=; b=GyuvVMEjFdOLUZVyzyFaFYi/4OAuGlTyaDle54H5UqD0L6fdst3t52iVRy8tr13Ztm1q24 4xGUp08TCdBi/IAbVFOvgAMyMIXMi1eMCEX5Yvm36TxRebdBkS0W4tlVlIjoRh3lN4ui8C d+sL0SETVBqPEX549zWdeB5fo6mJiSs= X-MC-Unique: E289zV1DPlGdgS2_6yQUFQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 2/7] qemu_capabilities: Decrease scope of @hash in virQEMUCapsProbeQMPHostCPU() Date: Thu, 22 Dec 2022 14:01:38 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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: 1671714188725100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The @hash variable inside of virQEMUCapsProbeQMPHostCPU() is used only within a loop, but declared at the beginning of the function. Bring the variable declaration into the said loop. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_capabilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3aba9299b1..adcd3b21a6 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3035,7 +3035,6 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps, const char *model =3D virQEMUCapsTypeIsAccelerated(virtType) ? "host" = : "max"; g_autoptr(qemuMonitorCPUModelInfo) modelInfo =3D NULL; g_autoptr(qemuMonitorCPUModelInfo) nonMigratable =3D NULL; - g_autoptr(GHashTable) hash =3D NULL; g_autoptr(virCPUDef) cpu =3D NULL; qemuMonitorCPUModelExpansionType type; bool fail_no_props =3D true; @@ -3079,6 +3078,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps, return -1; =20 if (nonMigratable) { + g_autoptr(GHashTable) hash =3D NULL; qemuMonitorCPUProperty *prop; qemuMonitorCPUProperty *nmProp; size_t i; --=20 2.38.2