From nobody Mon Feb 9 09:08:34 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=1632235863; cv=none; d=zohomail.com; s=zohoarc; b=dgQ5y/MRJjQrVXgs0Ig6jN2WqDyLP4zyRuHdIAbm81zZcFY23SIde2pz3yV6X17LsYQYgQSSwoAYDTJkYTIlTel7sPHhtCfwqpqQceggmCTZz8h4N/dzqVE47mayAV7wdjJa6d9jto7rWfrRZ18AiHj5hIqhV2tvAwa1bUCD/cI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1632235863; h=Content-Type:Content-Transfer-Encoding:Cc: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=45DB2W9TggCHKH3Xv4x4OpN31Ho6/110OnUAlOvOoxA=; b=KcEPE12mZWwz17oegqXjsmwKqfilvV6So6ZhPcYP9xiRVC/no7/DJhNh5vOA4lWhjn+d3OfY1Bbtm8eP1rPe8YDRVCHE0d1dCTtiDzn82FWx6LaT0A8fseqRb+Y+DXCfFf5P4E3ZwmwIejNRcjTLoaGroaO4DDb7m5FQVzkD/KA= 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 1632235863552900.0022099519128; Tue, 21 Sep 2021 07:51:03 -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-194-n5Axj0fgMfWp5OX_a3sQsQ-1; Tue, 21 Sep 2021 10:51:00 -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 CA36619057A6; Tue, 21 Sep 2021 14:50:52 +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 A97CB5BAEB; Tue, 21 Sep 2021 14:50:52 +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 67E5A180BAD1; Tue, 21 Sep 2021 14:50:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18LEof4u009998 for ; Tue, 21 Sep 2021 10:50:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5617E6ACE0; Tue, 21 Sep 2021 14:50:41 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEC441865D; Tue, 21 Sep 2021 14:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632235862; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=45DB2W9TggCHKH3Xv4x4OpN31Ho6/110OnUAlOvOoxA=; b=faSx+56gfic0AU/ESHsE7iUAL/F7WUah7fq2Ms/tSa/xqI1xUYs9wuiFQoyO4yK/RvC2ho XumP2OYAp+gx7BHuGcGKayDOSNbntEJ/irifcVUNvMh9/fTNYp76U1Jvxh5zgh7v5Rg+Pq sje2So3fSAkPri8tGMufewwO62trKLU= X-MC-Unique: n5Axj0fgMfWp5OX_a3sQsQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/5] qemuBuildNumaCommandLine: Move vars into loops Date: Tue, 21 Sep 2021 16:50:29 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: imammedo@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) X-ZM-MESSAGEID: 1632235865199100001 Content-Type: text/plain; charset="utf-8" There are two variables that are used only in a single loop. Move their definitions into their respective blocks. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/qemu/qemu_command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3de37aa5c5..020cbfa214 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7416,11 +7416,9 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, size_t i, j; virQEMUCaps *qemuCaps =3D priv->qemuCaps; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - char *next =3D NULL; virBuffer *nodeBackends =3D NULL; bool needBackend =3D false; bool hmat =3D false; - int rc; int ret =3D -1; size_t ncells =3D virDomainNumaGetNodeCount(def->numa); ssize_t masterInitiator =3D -1; @@ -7445,6 +7443,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_RAM) || virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_FILE) || virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_MEMORY_MEMFD)) { + int rc; =20 for (i =3D 0; i < ncells; i++) { if ((rc =3D qemuBuildMemoryCellBackendStr(def, cfg, i, priv, @@ -7487,6 +7486,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, =20 if (cpumask) { g_autofree char *cpumaskStr =3D NULL; + char *next =3D NULL; char *tmpmask; =20 if (!(cpumaskStr =3D virBitmapFormat(cpumask))) --=20 2.32.0