From nobody Sun Feb 8 21:33:25 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=1621255487; cv=none; d=zohomail.com; s=zohoarc; b=WwH4hu1PIWvAPtbMBwqA/n2EU+tGAZCk560270xFDPEH64E7Yd+h5o64mjW/hfoNVwKlzHGGebfMBvekjHsUqJE9EdTjeEDiHcSoqC3dR3b+qgjZjsCNLrUp0GoWNiY3CruRgKjK2csbNuy4xjnVeavjIOoMX4O7z5OjjSJGF6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1621255487; 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=x84FijrNImbpXbxdLzUUkcHczUGedDYsV2XW/xRtYkY=; b=S3WWehZEkjGmVOCmyM0QyDqwxHlzceDujMfAbeSZEfpiIzIjTvJOvA6xGbJ1xhjvCxUX4OUDEZ/OBJ5xjusM5NZlbAvLtPqFIhPXSmV09U8QDMi7qJvq7JAALiWhbd2qIhhAQX7Vd96MNCa4tBbAbWTFLeTKWbmWBnw6Fp4Lvzs= 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) header.from= 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 1621255487652990.972453075721; Mon, 17 May 2021 05:44:47 -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-596-dCKg5-4WMv24DoE_B5_m2g-1; Mon, 17 May 2021 08:44:43 -0400 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 2DDC0801AEB; Mon, 17 May 2021 12:44:39 +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 10EE65B68E; Mon, 17 May 2021 12:44:39 +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 D4552180B463; Mon, 17 May 2021 12:44:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 14HCiRxP015641 for ; Mon, 17 May 2021 08:44:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 84A381899A; Mon, 17 May 2021 12:44:27 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 096FA179B3 for ; Mon, 17 May 2021 12:44:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621255486; 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=x84FijrNImbpXbxdLzUUkcHczUGedDYsV2XW/xRtYkY=; b=e7xaL1QYSSvzthRyo+8zAPokxm1lVuVhaIFNRV1ZxMdGiwwPaZENgB87nH5v25j1zyDmVg m6NPdDL1yoSkAKgE9p3EE+aZ2+vCJtTZAKnR2FdzNgRYwDTJBYk3mSW/xHTSX4Psf68/WZ FP1yfmNZe9J/aMCUd3p/vcm8l3H6+Sc= X-MC-Unique: dCKg5-4WMv24DoE_B5_m2g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] virCapabilitiesHostNUMAFormat: Bring variables into loops Date: Mon, 17 May 2021 14:44:18 +0200 Message-Id: <8ececc4ce0665891ec9ff7fc20feb9b8c4924373.1621255232.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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) Content-Type: text/plain; charset="utf-8" Signed-off-by: Michal Privoznik --- src/conf/capabilities.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 1dae6d38cc..915cd3149e 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -807,8 +807,6 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf, virCapsHostNUMA *caps) { size_t i; - size_t j; - char *siblings; =20 if (!caps) return 0; @@ -819,6 +817,8 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf, virBufferAdjustIndent(buf, 2); for (i =3D 0; i < caps->cells->len; i++) { virCapsHostNUMACell *cell =3D g_ptr_array_index(caps->cells, i); + size_t j; + virBufferAsprintf(buf, "\n", cell->num); virBufferAdjustIndent(buf, 2); =20 @@ -847,10 +847,12 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf, =20 virBufferAsprintf(buf, "\n", cell->ncpus); virBufferAdjustIndent(buf, 2); - for (j =3D 0; j < cell->ncpus; j++) { + for (j =3D 0; j < cell->ncpus; ++j) { virBufferAsprintf(buf, "cpus[j].id); =20 if (cell->cpus[j].siblings) { + g_autofree char * siblings =3D NULL; + if (!(siblings =3D virBitmapFormat(cell->cpus[j].siblings)= )) return -1; =20 @@ -860,7 +862,6 @@ virCapabilitiesHostNUMAFormat(virBuffer *buf, cell->cpus[j].die_id, cell->cpus[j].core_id, siblings); - VIR_FREE(siblings); } virBufferAddLit(buf, "/>\n"); } --=20 2.26.3