From nobody Sun Feb 8 14:56:10 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=1629383350; cv=none; d=zohomail.com; s=zohoarc; b=AJZyH0Q03T9jwxoPe6L8O6bcNp8TISkdzXbX6gM/p9s4kf/xGt2AhmmwztCB5jYXMvSakaBGCK2zKi7wKkREg9xKlKJX+ZfDqjMH7YLmKoMNatjeIzplTvNSLm6TexgKVW2Ems/hnHKDZu0nsvZ16xGxH75PoYV9TS7MGWJ5KnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629383350; 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=8cj0gtThxAPeLYEPEWpyGX11cCFl6yumVP3iCGd5tCM=; b=eSaPoy46016muMcXhe58UkY2AiWLe4hjwBxhAjwXwf2niNWpf285XKd5A6f/YKouPfyZdUDJ/7SXSLdw1kZwN1RH8nq++Arddf1EWXQB2Wm8qVgeqJ7f6B8UBdidWLAq4AiIeMxb0XyA/wehLHOIIKA4KSyXZeZNGNItB/6PFc8= 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) 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 1629383350042695.9627305633871; Thu, 19 Aug 2021 07:29:10 -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-387-qwPjOyJIMzCHzFRgAlgldw-1; Thu, 19 Aug 2021 10:29:07 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A77911932484; Thu, 19 Aug 2021 14:29:02 +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 840D961096; Thu, 19 Aug 2021 14:29:02 +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 2B717181A2A6; Thu, 19 Aug 2021 14:29:02 +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 17JERB91016891 for ; Thu, 19 Aug 2021 10:27:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id CFAC25C1D1; Thu, 19 Aug 2021 14:27:11 +0000 (UTC) Received: from bart.redhat.com (unknown [10.43.2.192]) by smtp.corp.redhat.com (Postfix) with ESMTP id 595BA5C1BB for ; Thu, 19 Aug 2021 14:27:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629383349; 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=8cj0gtThxAPeLYEPEWpyGX11cCFl6yumVP3iCGd5tCM=; b=DP/9SdvJHHfyPqOsLiByZFbr6a3f5QMxmUehCKKcA2vIrp2Opx1V6CobMdGJECpGlAsCPR XgFHsLpXD3Qaugzxghm8MA888alTsX7SEetMFuvucQ8Pn1bX6e7TkONgOs4tV08tQTcjN6 vKCv//4Op0T5+Kge2TtvRhXcY1fjaDo= X-MC-Unique: qwPjOyJIMzCHzFRgAlgldw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/5] conf: Introduce virCapabilitiesHostNUMAGetMaxNode() Date: Thu, 19 Aug 2021 16:27:01 +0200 Message-Id: <1d7ade1592f11a92cdacda4d2246d261ec71afde.1629383171.git.mprivozn@redhat.com> In-Reply-To: References: 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.12 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: 1629383350796100001 Content-Type: text/plain; charset="utf-8" This is just a small helper that will be used later. Signed-off-by: Michal Privoznik --- src/conf/capabilities.c | 9 +++++++++ src/conf/capabilities.h | 2 ++ src/libvirt_private.syms | 1 + 3 files changed, 12 insertions(+) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 72d4146ac3..a3e68741a9 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1433,6 +1433,15 @@ virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps, } =20 =20 +int +virCapabilitiesHostNUMAGetMaxNode(virCapsHostNUMA *caps) +{ + virCapsHostNUMACell *cell =3D g_ptr_array_index(caps->cells, caps->cel= ls->len - 1); + + return cell->num; +} + + int virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo) { diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 1b99202c9b..701878332c 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -328,6 +328,8 @@ virCapabilitiesFormatXML(virCaps *caps); virBitmap *virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps, virBitmap *nodemask); =20 +int virCapabilitiesHostNUMAGetMaxNode(virCapsHostNUMA *caps); + int virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo); =20 int virCapabilitiesInitPages(virCaps *caps); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index fcb02c21b1..9870c5a37c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -69,6 +69,7 @@ virCapabilitiesGetNodeInfo; virCapabilitiesHostInitIOMMU; virCapabilitiesHostNUMAAddCell; virCapabilitiesHostNUMAGetCpus; +virCapabilitiesHostNUMAGetMaxNode; virCapabilitiesHostNUMANew; virCapabilitiesHostNUMANewHost; virCapabilitiesHostNUMARef; --=20 2.31.1