From nobody Sun Nov 10 19:48:42 2024 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=1678274182; cv=none; d=zohomail.com; s=zohoarc; b=GQY2ED2szkf6bSPiDQ37tAyDLscXa4Sn2B39chxS2HAv8aTQB1LRerJbShaLNVeGrX4fOZrlPGwWuCwHwZHsaFnVOJyferAeJAS1aLEmYxG984ZscxCEz2OudMrmA4jJh/C9BIDajb6gtwRBT+Tz5GYcc9+pejPcUug/zre9WGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274182; 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=f5MMbRqpQnJmBWYpBPWRis9mkUFaCF50Nt0W44dl1Jg=; b=PPuYChtEIYCyOdD8IwKfXKY0wSZMeiS9oaDsvOVnJMTt9QW9lzH1xY3cul0rU4ct0M+Ar56S5j45SXfdPKjtnQZoyVOjbiVvXGcoQGRH+NGHA+p6LfGbwzuPAkwCDJSUuaVcSEOuTQ5fdqRMJn/Vjo4vxa6pQsP9OYahYPzM1Yo= 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 1678274182125795.3805323504096; Wed, 8 Mar 2023 03:16:22 -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-626-SeLK-s8RPWO29whCiIgwXw-1; Wed, 08 Mar 2023 06:16:17 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 808253814585; Wed, 8 Mar 2023 11:16:15 +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 6E579492B04; Wed, 8 Mar 2023 11:16:15 +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 4EEDD19465B2; Wed, 8 Mar 2023 11:16:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E828519465B1 for ; Wed, 8 Mar 2023 11:14:43 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DC1E8112132D; Wed, 8 Mar 2023 11:14:43 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E2F21121314 for ; Wed, 8 Mar 2023 11:14:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274181; 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=f5MMbRqpQnJmBWYpBPWRis9mkUFaCF50Nt0W44dl1Jg=; b=I8OSsskvwzlbhkUMUYF8NLcqnad3YD/nUq8p9S/biLl8zn18eaxG3ktCu+rWvwCiKmbq1+ CSJHcvj2OsLstXotoKBnXy50qZD1v2QV5857RrBmVJNgeAXFPADUtAwD1aPYNmEj6EEAuv SzbgTNhBpY1lvyFRqgkfZaSmxE+Chds= X-MC-Unique: SeLK-s8RPWO29whCiIgwXw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 01/14] virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL Date: Wed, 8 Mar 2023 12:14:28 +0100 Message-Id: <9825d94033018f2873288cfbe520ba39f5271220.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.9 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: 1678274182472100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Technically, there's nothing libnuma specific about virNumaNodesetToCPUset(). It just implements a generic algorithm over virNumaGetNodeCPUs() (which is then libnuma dependant). Nevertheless, there's no need to have this function living inside WITH_NUMACTL block. Any error returned from virNumaGetNodeCPUs() (including the one that !WITH_NUMACTL stub returns) is propagated properly. Move the function out of the block into a generic one and drop the !WITH_NUMACTL stub. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: Kristina Hanicova --- src/util/virnuma.c | 115 +++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 62 deletions(-) diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 43e299f4bb..dae0827c65 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -311,57 +311,6 @@ virNumaGetNodeCPUs(int node, # undef MASK_CPU_ISSET # undef n_bits =20 -/** - * virNumaNodesetToCPUset: - * @nodeset: bitmap containing a set of NUMA nodes - * @cpuset: return location for a bitmap containing a set of CPUs - * - * Convert a set of NUMA node to the set of CPUs they contain. - * - * Returns 0 on success, <0 on failure. - */ -int -virNumaNodesetToCPUset(virBitmap *nodeset, - virBitmap **cpuset) -{ - g_autoptr(virBitmap) allNodesCPUs =3D NULL; - size_t nodesetSize; - size_t i; - - *cpuset =3D NULL; - - if (!nodeset) - return 0; - - allNodesCPUs =3D virBitmapNew(0); - nodesetSize =3D virBitmapSize(nodeset); - - for (i =3D 0; i < nodesetSize; i++) { - g_autoptr(virBitmap) nodeCPUs =3D NULL; - int rc; - - if (!virBitmapIsBitSet(nodeset, i)) - continue; - - rc =3D virNumaGetNodeCPUs(i, &nodeCPUs); - if (rc < 0) { - /* Error is reported for cases other than non-existent NUMA no= de. */ - if (rc =3D=3D -2) { - virReportError(VIR_ERR_OPERATION_FAILED, - _("NUMA node %zu is not available"), - i); - } - return -1; - } - - virBitmapUnion(allNodesCPUs, nodeCPUs); - } - - *cpuset =3D g_steal_pointer(&allNodesCPUs); - - return 0; -} - #else /* !WITH_NUMACTL */ =20 int @@ -417,17 +366,6 @@ virNumaGetNodeCPUs(int node G_GNUC_UNUSED, return -1; } =20 -int -virNumaNodesetToCPUset(virBitmap *nodeset G_GNUC_UNUSED, - virBitmap **cpuset) -{ - *cpuset =3D NULL; - - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("NUMA isn't available on this host")); - return -1; -} - #endif /* !WITH_NUMACTL */ =20 /** @@ -1050,3 +988,56 @@ virNumaGetHostMemoryNodeset(void) =20 return nodeset; } + + +/** + * virNumaNodesetToCPUset: + * @nodeset: bitmap containing a set of NUMA nodes + * @cpuset: return location for a bitmap containing a set of CPUs + * + * Convert a set of NUMA node to the set of CPUs they contain. + * + * Returns 0 on success, + * -1 on failure (with error reported). + */ +int +virNumaNodesetToCPUset(virBitmap *nodeset, + virBitmap **cpuset) +{ + g_autoptr(virBitmap) allNodesCPUs =3D NULL; + size_t nodesetSize; + size_t i; + + *cpuset =3D NULL; + + if (!nodeset) + return 0; + + allNodesCPUs =3D virBitmapNew(0); + nodesetSize =3D virBitmapSize(nodeset); + + for (i =3D 0; i < nodesetSize; i++) { + g_autoptr(virBitmap) nodeCPUs =3D NULL; + int rc; + + if (!virBitmapIsBitSet(nodeset, i)) + continue; + + rc =3D virNumaGetNodeCPUs(i, &nodeCPUs); + if (rc < 0) { + /* Error is reported for cases other than non-existent NUMA no= de. */ + if (rc =3D=3D -2) { + virReportError(VIR_ERR_OPERATION_FAILED, + _("NUMA node %zu is not available"), + i); + } + return -1; + } + + virBitmapUnion(allNodesCPUs, nodeCPUs); + } + + *cpuset =3D g_steal_pointer(&allNodesCPUs); + + return 0; +} --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274118; cv=none; d=zohomail.com; s=zohoarc; b=lXLRoPuT5VM3IkZUUD8TRd9t0qrl2HZpros2GZ3kRCY0rCwWuQNMz8A/k5r7dIBkB+SOQr7EyQfnzsKKZ5tCDgL77S52DgsSTPjH9ZmJlnk4J+4piOwsyN8iiZ6bKQIptFXiYauG+K86z82Jj43zkVXka+zAJ7PI6n5Lp/RrCDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274118; 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=oS2HNWwPMbvB/R6wn4qbOQ430T2va7xkr65YbIAXwGw=; b=lVG7xIQzmt6GTfpuHxAj0+4R+TUaMalgJ1JuouEbpWKueHA5xu+lLaAP3NcYXa3OqdUXFWiTwtPEcI5nXZSPpHt2UHY3QoB+wkxEGNDNz02LsWZPp/OgXJbP9/UlftcANWx4+KUwu1bhio1SBShNWUoioOK/iW3QZ4QkK6AP0q4= 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 167827411829413.88123718885879; Wed, 8 Mar 2023 03:15:18 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-270-UIxjAoXlMrWnDwDtZE2S_Q-1; Wed, 08 Mar 2023 06:15:06 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E6DE385D06E; Wed, 8 Mar 2023 11:15:03 +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 D3A65400DB36; Wed, 8 Mar 2023 11:15:03 +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 BC49719465B5; Wed, 8 Mar 2023 11:15:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A9A8419465B1 for ; Wed, 8 Mar 2023 11:14:44 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 809F1112132D; Wed, 8 Mar 2023 11:14:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22F2B1121314 for ; Wed, 8 Mar 2023 11:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274117; 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=oS2HNWwPMbvB/R6wn4qbOQ430T2va7xkr65YbIAXwGw=; b=AR10o0T9ee9zcqZVkJ8VzMDl7c6BQkh3z0wIyG2Of/S0zuJmMXUVElZSvR2BjMWOIUJAwW 2Wb17B9uVEuxu2PiNPo+dy0/SDhLYE1MbRuXknnkMApI736YAjkUKEJiWjauLyM6uWNnJ9 4ADc5hnuRLE/2gF3jWK3T2DCXmRylNM= X-MC-Unique: UIxjAoXlMrWnDwDtZE2S_Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 02/14] virnuma: Introduce virNumaCPUSetToNodeset() Date: Wed, 8 Mar 2023 12:14:29 +0100 Message-Id: <0102038c19ca2d1ff95a9d0015552026a96f61bf.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.1 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: 1678274120178100001 Content-Type: text/plain; charset="utf-8"; x-default="true" So far, we have a function that expands given list of NUMA nodes into list of CPUs. But soon, we are going to need the inverse - expand list of CPUs into list of NUMA nodes. Introduce virNumaCPUSetToNodeset() for that. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/libvirt_private.syms | 2 ++ src/util/virnuma.c | 59 ++++++++++++++++++++++++++++++++++++++++ src/util/virnuma.h | 3 ++ 3 files changed, 64 insertions(+) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index d5b1b9cb72..3ae97e62de 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2975,6 +2975,7 @@ virNodeSuspendGetTargetMask; =20 =20 # util/virnuma.h +virNumaCPUSetToNodeset; virNumaGetAutoPlacementAdvice; virNumaGetDistances; virNumaGetHostMemoryNodeset; @@ -2982,6 +2983,7 @@ virNumaGetMaxCPUs; virNumaGetMaxNode; virNumaGetNodeCPUs; virNumaGetNodeMemory; +virNumaGetNodeOfCPU; virNumaGetPageInfo; virNumaGetPages; virNumaIsAvailable; diff --git a/src/util/virnuma.c b/src/util/virnuma.c index dae0827c65..5f484a16f5 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -311,6 +311,22 @@ virNumaGetNodeCPUs(int node, # undef MASK_CPU_ISSET # undef n_bits =20 + +/** + * virNumaGetNodeOfCPU: + * @cpu: CPU ID + * + * For given @cpu, return NUMA node which it belongs to. + * + * Returns: NUMA node # on success, + * -1 on failure (with errno set). + */ +int +virNumaGetNodeOfCPU(int cpu) +{ + return numa_node_of_cpu(cpu); +} + #else /* !WITH_NUMACTL */ =20 int @@ -366,6 +382,14 @@ virNumaGetNodeCPUs(int node G_GNUC_UNUSED, return -1; } =20 +int +virNumaGetNodeOfCPU(int cpu G_GNUC_UNUSED) +{ + errno =3D ENOSYS; + return -1; +} + + #endif /* !WITH_NUMACTL */ =20 /** @@ -990,6 +1014,41 @@ virNumaGetHostMemoryNodeset(void) } =20 =20 +/** + * virNumaNodesetToCPUset: + * @nodeset: returned bitmap containing a set of NUMA nodes + * @cpuset: bitmap containing a set of CPUs + * + * Convert a set of CPUs to set of NUMA nodes that contain the CPUs. + * + * Returns: 0 on success, + * -1 on failure (with error reported) + */ +int +virNumaCPUSetToNodeset(virBitmap **nodeset, + virBitmap *cpuset) +{ + g_autoptr(virBitmap) nodes =3D virBitmapNew(0); + ssize_t pos =3D -1; + + while ((pos =3D virBitmapNextSetBit(cpuset, pos)) >=3D 0) { + int node =3D virNumaGetNodeOfCPU(pos); + + if (node < 0) { + virReportSystemError(errno, + _("Unable to get NUMA node of cpu %zd"), + pos); + return -1; + } + + virBitmapSetBitExpand(nodes, node); + } + + *nodeset =3D g_steal_pointer(&nodes); + return 0; +} + + /** * virNumaNodesetToCPUset: * @nodeset: bitmap containing a set of NUMA nodes diff --git a/src/util/virnuma.h b/src/util/virnuma.h index c35acd47cb..67e699f2cf 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -45,7 +45,10 @@ int virNumaGetNodeMemory(int node, =20 unsigned int virNumaGetMaxCPUs(void) G_NO_INLINE; =20 +int virNumaGetNodeOfCPU(int cpu); int virNumaGetNodeCPUs(int node, virBitmap **cpus) G_NO_INLINE; +int virNumaCPUSetToNodeset(virBitmap **nodeset, + virBitmap *cpuset); int virNumaNodesetToCPUset(virBitmap *nodeset, virBitmap **cpuset); =20 --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274194; cv=none; d=zohomail.com; s=zohoarc; b=SzscoKq88wsvfvhou/OOCUpOVv1VxYMmYYYMmQdT7KIgIHoCOe7JjpabDlm6N40HnI6lLlXVPpIurqACTo9irwOr0FMsIy6nbA5EkUA+uaKvFQIA66eAO9A5hvdHBVtBJFSQHTr0UagvkxDrdU5smETNkpx6C6KIG3otuJrW7zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274194; 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=lWjcqs/tNqmZpxX4HT5k63Z/ACfP/9+fAI0EzAD9BwA=; b=PbvGgCeKOV4Qtiqrym08oDKkeFlhWsfdZJe/nwti+5uACLa1SsWqvW9c9CeogJH2lDjlDyGgOBYaxCFwGTaxxqocFefaRvK+EXSJ7Vmg9N0NqbmMxXQ6AieDBz2DVs02lrhrbRUvsxHPJ7dq7nOwFSbxNv7OqcQePNs9TQ8RNvo= 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 1678274194932745.1090656017573; Wed, 8 Mar 2023 03:16:34 -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-372-zVSKcCMxOByUJmjta-J90A-1; Wed, 08 Mar 2023 06:16:27 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9A19296A607; Wed, 8 Mar 2023 11:16:24 +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 C4E20440D9; Wed, 8 Mar 2023 11:16:24 +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 90F2B19465B2; Wed, 8 Mar 2023 11:16:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6D01A19465B1 for ; Wed, 8 Mar 2023 11:14:45 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 42E0A112132D; Wed, 8 Mar 2023 11:14:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBFA81121314 for ; Wed, 8 Mar 2023 11:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274193; 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=lWjcqs/tNqmZpxX4HT5k63Z/ACfP/9+fAI0EzAD9BwA=; b=cGTgBA5yEjAFeoESr9cPi13jht2Hm1zczWsIM9mh05CrqgdBAG1zbXTEnBV36SClU8pe5z HS08VPg8UeW+lcMgkazv4psoSuaFaD9h2W8rTw42fvwR/apK2Cp/ncvSuG3iyyaJW7J0JP wNJmbsanhfFft9qgt0UIr7Rs2Qs/9nU= X-MC-Unique: zVSKcCMxOByUJmjta-J90A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 03/14] virnumamock: Introduce virNumaGetNodeOfCPU() mock Date: Wed, 8 Mar 2023 12:14:30 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.5 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: 1678274196540100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Introduce a mock of virNumaGetNodeOfCPU() because soon we will need virNumaCPUSetToNodeset() to return predictable results. Also, fill in missing symlinks in vircaps2xmldata/. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: Kristina Hanicova --- src/util/virnuma.h | 2 +- .../linux-basic/system/cpu/cpu0/node0 | 1 + .../linux-basic/system/cpu/cpu1/node0 | 1 + .../linux-basic/system/cpu/cpu10/node2 | 1 + .../linux-basic/system/cpu/cpu11/node2 | 1 + .../linux-basic/system/cpu/cpu12/node3 | 1 + .../linux-basic/system/cpu/cpu13/node3 | 1 + .../linux-basic/system/cpu/cpu14/node3 | 1 + .../linux-basic/system/cpu/cpu15/node3 | 1 + .../linux-basic/system/cpu/cpu2/node0 | 1 + .../linux-basic/system/cpu/cpu3/node0 | 1 + .../linux-basic/system/cpu/cpu4/node1 | 1 + .../linux-basic/system/cpu/cpu5/node1 | 1 + .../linux-basic/system/cpu/cpu6/node1 | 1 + .../linux-basic/system/cpu/cpu7/node1 | 1 + .../linux-basic/system/cpu/cpu8/node2 | 1 + .../linux-basic/system/cpu/cpu9/node2 | 1 + .../linux-caches/system/cpu/cpu0/node0 | 1 + .../linux-caches/system/cpu/cpu1/node0 | 1 + .../linux-caches/system/cpu/cpu2/node0 | 1 + .../linux-caches/system/cpu/cpu3/node0 | 1 + .../linux-caches/system/cpu/cpu4/node0 | 1 + .../linux-caches/system/cpu/cpu5/node0 | 1 + .../linux-caches/system/cpu/cpu6/node0 | 1 + .../linux-caches/system/cpu/cpu7/node0 | 1 + .../system/cpu/cpu0/node0 | 1 + .../linux-resctrl/system/cpu/cpu0/node0 | 1 + .../linux-resctrl/system/cpu/cpu1/node0 | 1 + .../linux-resctrl/system/cpu/cpu10/node1 | 1 + .../linux-resctrl/system/cpu/cpu11/node1 | 1 + .../linux-resctrl/system/cpu/cpu2/node0 | 1 + .../linux-resctrl/system/cpu/cpu3/node0 | 1 + .../linux-resctrl/system/cpu/cpu4/node0 | 1 + .../linux-resctrl/system/cpu/cpu5/node0 | 1 + .../linux-resctrl/system/cpu/cpu6/node1 | 1 + .../linux-resctrl/system/cpu/cpu7/node1 | 1 + .../linux-resctrl/system/cpu/cpu8/node1 | 1 + .../linux-resctrl/system/cpu/cpu9/node1 | 1 + tests/virnumamock.c | 42 +++++++++++++++++++ 39 files changed, 80 insertions(+), 1 deletion(-) create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu0/node0 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu1/node0 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu10/node2 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu11/node2 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu12/node3 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu13/node3 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu14/node3 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu15/node3 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu2/node0 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu3/node0 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu4/node1 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu5/node1 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu6/node1 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu7/node1 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu8/node2 create mode 120000 tests/vircaps2xmldata/linux-basic/system/cpu/cpu9/node2 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu0/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu1/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu2/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu3/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu4/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu5/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu6/node0 create mode 120000 tests/vircaps2xmldata/linux-caches/system/cpu/cpu7/node0 create mode 120000 tests/vircaps2xmldata/linux-resctrl-skx-twocaches/syste= m/cpu/cpu0/node0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu0/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu1/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu10/no= de1 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu11/no= de1 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu2/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu3/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu4/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu5/nod= e0 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu6/nod= e1 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu7/nod= e1 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu8/nod= e1 create mode 120000 tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu9/nod= e1 diff --git a/src/util/virnuma.h b/src/util/virnuma.h index 67e699f2cf..21b3efee6d 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -45,7 +45,7 @@ int virNumaGetNodeMemory(int node, =20 unsigned int virNumaGetMaxCPUs(void) G_NO_INLINE; =20 -int virNumaGetNodeOfCPU(int cpu); +int virNumaGetNodeOfCPU(int cpu) G_NO_INLINE; int virNumaGetNodeCPUs(int node, virBitmap **cpus) G_NO_INLINE; int virNumaCPUSetToNodeset(virBitmap **nodeset, virBitmap *cpuset); diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu0/node0 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu0/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu0/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu1/node0 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu1/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu1/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu10/node2 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu10/node2 new file mode 120000 index 0000000000..e04af16eeb --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu10/node2 @@ -0,0 +1 @@ +../../node/node2 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu11/node2 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu11/node2 new file mode 120000 index 0000000000..e04af16eeb --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu11/node2 @@ -0,0 +1 @@ +../../node/node2 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu12/node3 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu12/node3 new file mode 120000 index 0000000000..f213d662fe --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu12/node3 @@ -0,0 +1 @@ +../../node/node3 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu13/node3 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu13/node3 new file mode 120000 index 0000000000..f213d662fe --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu13/node3 @@ -0,0 +1 @@ +../../node/node3 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu14/node3 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu14/node3 new file mode 120000 index 0000000000..f213d662fe --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu14/node3 @@ -0,0 +1 @@ +../../node/node3 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu15/node3 b/tes= ts/vircaps2xmldata/linux-basic/system/cpu/cpu15/node3 new file mode 120000 index 0000000000..f213d662fe --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu15/node3 @@ -0,0 +1 @@ +../../node/node3 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu2/node0 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu2/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu2/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu3/node0 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu3/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu3/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu4/node1 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu4/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu4/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu5/node1 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu5/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu5/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu6/node1 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu6/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu6/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu7/node1 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu7/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu7/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu8/node2 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu8/node2 new file mode 120000 index 0000000000..e04af16eeb --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu8/node2 @@ -0,0 +1 @@ +../../node/node2 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-basic/system/cpu/cpu9/node2 b/test= s/vircaps2xmldata/linux-basic/system/cpu/cpu9/node2 new file mode 120000 index 0000000000..e04af16eeb --- /dev/null +++ b/tests/vircaps2xmldata/linux-basic/system/cpu/cpu9/node2 @@ -0,0 +1 @@ +../../node/node2 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu0/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu0/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu0/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu1/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu1/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu1/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu2/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu2/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu2/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu3/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu3/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu3/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu4/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu4/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu4/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu5/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu5/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu5/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu6/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu6/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu6/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-caches/system/cpu/cpu7/node0 b/tes= ts/vircaps2xmldata/linux-caches/system/cpu/cpu7/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-caches/system/cpu/cpu7/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl-skx-twocaches/system/cpu/c= pu0/node0 b/tests/vircaps2xmldata/linux-resctrl-skx-twocaches/system/cpu/cp= u0/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl-skx-twocaches/system/cpu/cpu0/nod= e0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu0/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu0/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu0/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu1/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu1/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu1/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu10/node1 b/t= ests/vircaps2xmldata/linux-resctrl/system/cpu/cpu10/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu10/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu11/node1 b/t= ests/vircaps2xmldata/linux-resctrl/system/cpu/cpu11/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu11/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu2/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu2/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu2/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu3/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu3/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu3/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu4/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu4/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu4/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu5/node0 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu5/node0 new file mode 120000 index 0000000000..222b6af326 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu5/node0 @@ -0,0 +1 @@ +../../node/node0 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu6/node1 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu6/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu6/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu7/node1 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu7/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu7/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu8/node1 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu8/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu8/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu9/node1 b/te= sts/vircaps2xmldata/linux-resctrl/system/cpu/cpu9/node1 new file mode 120000 index 0000000000..1f9c101cd1 --- /dev/null +++ b/tests/vircaps2xmldata/linux-resctrl/system/cpu/cpu9/node1 @@ -0,0 +1 @@ +../../node/node1 \ No newline at end of file diff --git a/tests/virnumamock.c b/tests/virnumamock.c index 87c9a58c6f..8d5c862fa2 100644 --- a/tests/virnumamock.c +++ b/tests/virnumamock.c @@ -21,6 +21,7 @@ #include "internal.h" #include "virnuma.h" #include "virfile.h" +#include "virstring.h" =20 #define VIR_FROM_THIS VIR_FROM_NONE =20 @@ -171,3 +172,44 @@ virNumaGetNodeCPUs(int node, virBitmap **cpus) =20 return virBitmapCountBits(*cpus); } + +int +virNumaGetNodeOfCPU(int cpu) +{ + g_autoptr(DIR) cpuDir =3D NULL; + g_autofree char *sysfs_cpu_path =3D NULL; + struct dirent *ent =3D NULL; + int dirErr =3D 0; + + sysfs_cpu_path =3D g_strdup_printf("%s/cpu/cpu%d", SYSFS_SYSTEM_PATH,= cpu); + + if (virDirOpen(&cpuDir, sysfs_cpu_path) < 0) + return -1; + + while ((dirErr =3D virDirRead(cpuDir, &ent, sysfs_cpu_path)) > 0) { + g_autofree char *entPath =3D NULL; + const char *number =3D NULL; + int node; + + if (!(number =3D STRSKIP(ent->d_name, "node"))) + continue; + + entPath =3D g_strdup_printf("%s/%s", sysfs_cpu_path, ent->d_name); + + if (!virFileIsLink(entPath)) + continue; + + if (virStrToLong_i(number, NULL, 10, &node) < 0) { + errno =3D EINVAL; + return -1; + } + + return node; + } + + if (dirErr < 0) + return -1; + + errno =3D EINVAL; + return -1; +} --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274147; cv=none; d=zohomail.com; s=zohoarc; b=TZ7ijbjmYHOdjrye+/7Ibg9lk5YgDgI6GQWOqBNOWcLlVrIJGgjZEy3R/YWMpkOELe601h/i2LlPgFuHl0enAu7cJFF/kRtdnBf3AmEdN54w1bJkdljPhHNiLfmrXJ4m59GN7q4Dkhbb0AI5WUfS6Yg2dDqkd6TZnsZpB8/9fk8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274147; 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=7d6gKLp+MsMh5O/3uCgXgVXtWKKppSY0QnPmSG+mmgI=; b=DnLihuOBJBzUsEfZxr9SHWwDK2n1NU8p2S3KDzymrlNYGRrai7uj9oSMbQhkDWbrusrAcTf76IjOn/UjRo/Haw46ZceVDCmko/cRy8DhFzZh2rWrHopr3BCEo32elleT+Lpx35P3kdESa6sMHeFedNlSfH0C7FI0IF/oYxzu7nw= 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 1678274146998388.2905964020672; Wed, 8 Mar 2023 03:15:46 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-332-qTlEzr_qPQGkC9pGHPLGTw-1; Wed, 08 Mar 2023 06:15:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 979B9882820; Wed, 8 Mar 2023 11:15:37 +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 84F822166B26; Wed, 8 Mar 2023 11:15:37 +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 54D5819465BC; Wed, 8 Mar 2023 11:15:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 00E4319465B1 for ; Wed, 8 Mar 2023 11:14:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DBCB51121330; Wed, 8 Mar 2023 11:14:45 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E1F31121314 for ; Wed, 8 Mar 2023 11:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274146; 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=7d6gKLp+MsMh5O/3uCgXgVXtWKKppSY0QnPmSG+mmgI=; b=Oh8GaEJd+vhn+vPQm1bA2Q24BnAEuacNNqDpg1SF5g0nw91YBfrLBW8ar10oksPqu0nEMI YjPQQe5Z9k2WXmvhBv9JkmLkUPuPve8YZqYKvGc6pyjKRl52z4IEpWFcmcitDi7P8Xuj6U D3LhPd/D+K386W8V+m4FxjYeZY3LwzU= X-MC-Unique: qTlEzr_qPQGkC9pGHPLGTw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 04/14] qemuxml2argvtest: Use virnuma mock Date: Wed, 8 Mar 2023 12:14:31 +0100 Message-Id: <1e019acf635b9908226f9cf30424d492e57e6023.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.6 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: 1678274148298100001 Content-Type: text/plain; charset="utf-8"; x-default="true" While no part of cmd line building process currently depends on a host NUMA configuration, this will change soon. Use freshly changed virnumamock from qemuxml2argvtest and make the mock read NUMA data from vircaps2xmldata which seems to have the most rich NUMA configuration. This also means, we have to start building virnumamock unconditionally. But this is not a problem, since nothing inside of the mock relies on Linux specificity. The whole mock is merely just reading files and parsing them. Signed-off-by: Michal Privoznik --- tests/meson.build | 2 +- tests/qemuxml2argvtest.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/meson.build b/tests/meson.build index 15b049c6ac..44a04698cf 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -88,13 +88,13 @@ mock_libs =3D [ { 'name': 'virportallocatormock' }, { 'name': 'virprocessmock' }, { 'name': 'virrandommock' }, + { 'name': 'virnumamock' }, ] =20 if host_machine.system() =3D=3D 'linux' mock_libs +=3D [ { 'name': 'virfilemock' }, { 'name': 'virnetdevbandwidthmock' }, - { 'name': 'virnumamock' }, { 'name': 'virtestmock' }, { 'name': 'virusbmock' }, ] diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 740d7a5db5..8bc0b5147f 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -830,6 +830,8 @@ mymain(void) linuxCaps =3D driver.caps; macOSCaps =3D testQemuCapsInitMacOS(); =20 + virFileWrapperAddPrefix("/sys/devices/system", + abs_srcdir "/vircaps2xmldata/linux-basic/syste= m"); virFileWrapperAddPrefix(SYSCONFDIR "/qemu/firmware", abs_srcdir "/qemufirmwaredata/etc/qemu/firmwar= e"); virFileWrapperAddPrefix(PREFIX "/share/qemu/firmware", @@ -2908,7 +2910,8 @@ VIR_TEST_MAIN_PRELOAD(mymain, VIR_TEST_MOCK("domaincaps"), VIR_TEST_MOCK("virrandom"), VIR_TEST_MOCK("qemucpu"), - VIR_TEST_MOCK("virpci")) + VIR_TEST_MOCK("virpci"), + VIR_TEST_MOCK("virnuma")) =20 #else =20 --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274192; cv=none; d=zohomail.com; s=zohoarc; b=KHMLYz0HB1pLp9XJuwj9vDRVC2gjx7nb6yfmH6TDstNeXD7zCX9Ww8UcZd0XCGeJhiKifeFC35NQIYK+tUebp+L9Ty595yN2dNEpYSkiW+iNWBKCpBR54i0FR5vxENZH99L6mNYh1YkMYXeB0PKJJ2LgZCuF7l9Qi2pYAWe/aC8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274192; 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=C6FqQtVj4eGcJnoF6erP+JbScaDyoMRLSpb7K4ngsIY=; b=QEglXR3yD5BnbkkHJUh/kv+jOnpN+ZUvOjCLBPH9syF+Gy8yt/NsssUMql9yLinn4iApWM9mh/L5tLmVLihjMTzxoKb2//fALraQI/Z1CI5k8qC7UIWdcG456Mshx1T0bqdTP82/+da1aE4RDQdF3rHZbmdScUzSx4UC+xNVdvs= 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 1678274192288594.4241674834796; Wed, 8 Mar 2023 03:16:32 -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-342-swpEZvIPNRCFcdgWSeT0sw-1; Wed, 08 Mar 2023 06:16:27 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 604662932484; Wed, 8 Mar 2023 11:16:25 +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 4A826111F3BB; Wed, 8 Mar 2023 11:16:25 +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 CE1AD1946A41; Wed, 8 Mar 2023 11:16:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A9E1919465B1 for ; Wed, 8 Mar 2023 11:14:46 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 80EBA112132D; Wed, 8 Mar 2023 11:14:46 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 231E71121314 for ; Wed, 8 Mar 2023 11:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274191; 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=C6FqQtVj4eGcJnoF6erP+JbScaDyoMRLSpb7K4ngsIY=; b=T+zAp6ZdyPmyG2kkLtavpwqTTEHvAEz/hXenXvwDEh7rfn83yIyVrZH1vtHkGU9JJsNIDb EPYUhcOXT2FpdMGTcp/ivdANaViX1g8JALhIuRg5/AgOlqcQVafoAJo3FKLVYCXEA6HdWR +J+kw/j2n15TJZNHz2xolF9nxO+XwaI= X-MC-Unique: swpEZvIPNRCFcdgWSeT0sw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 05/14] qemuxml2argvdata: Adjust maximum NUMA node used Date: Wed, 8 Mar 2023 12:14:32 +0100 Message-Id: <5a80a1751fd6e3a86172cb4e9f5134a804704d37.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.3 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: 1678274192794100001 Content-Type: text/plain; charset="utf-8"; x-default="true" We have couple of qemuxml2argvtest cases where up to 8 NUMA nodes are assumed. These are used to check whether disjoint ranges of host-nodes=3D is generated properly. Without prejudice to the generality, we can rewrite corresponding XML files to use up to 4 NUMA nodes and still have disjoint ranges. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvdata/migrate-numa-unaligned.args | 4 ++-- tests/qemuxml2argvdata/migrate-numa-unaligned.xml | 4 ++-- tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml | 4 ++-- tests/qemuxml2argvdata/numatune-memnode.args | 4 ++-- tests/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args | 4 ++-- tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args | 4 ++-- tests/qemuxml2argvdata/numatune-memnode.xml | 4 ++-- tests/qemuxml2xmloutdata/numatune-memnode.xml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/qemuxml2argvdata/migrate-numa-unaligned.args b/tests/qem= uxml2argvdata/migrate-numa-unaligned.args index 6e961cba84..04d4903065 100644 --- a/tests/qemuxml2argvdata/migrate-numa-unaligned.args +++ b/tests/qemuxml2argvdata/migrate-numa-unaligned.args @@ -17,9 +17,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st/.config \ -smp 32,sockets=3D32,cores=3D1,threads=3D1 \ -object memory-backend-ram,id=3Dram-node0,size=3D20482048,host-nodes=3D3,p= olicy=3Dpreferred \ -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ --object memory-backend-ram,id=3Dram-node1,size=3D675907584,host-nodes=3D0-= 7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node1,size=3D675907584,host-nodes=3D0-= 3,policy=3Dbind \ -numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ --object memory-backend-ram,id=3Dram-node2,size=3D24578457600,host-nodes=3D= 1-2,host-nodes=3D5,host-nodes=3D7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node2,size=3D24578457600,host-nodes=3D= 0,host-nodes=3D2,policy=3Dbind \ -numa node,nodeid=3D2,cpus=3D28,cpus=3D30-31,memdev=3Dram-node2 \ -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ -display none \ diff --git a/tests/qemuxml2argvdata/migrate-numa-unaligned.xml b/tests/qemu= xml2argvdata/migrate-numa-unaligned.xml index e46b723acb..c060852297 100644 --- a/tests/qemuxml2argvdata/migrate-numa-unaligned.xml +++ b/tests/qemuxml2argvdata/migrate-numa-unaligned.xml @@ -6,8 +6,8 @@ 32 - - + + hvm diff --git a/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml b= /tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml index 012c526460..2a640f5501 100644 --- a/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml +++ b/tests/qemuxml2argvdata/numatune-memnode-restrictive-mode.xml @@ -5,9 +5,9 @@ 24682468 32 - + - + hvm diff --git a/tests/qemuxml2argvdata/numatune-memnode.args b/tests/qemuxml2a= rgvdata/numatune-memnode.args index ab222f53db..917746a523 100644 --- a/tests/qemuxml2argvdata/numatune-memnode.args +++ b/tests/qemuxml2argvdata/numatune-memnode.args @@ -17,9 +17,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st/.config \ -smp 32,sockets=3D32,cores=3D1,threads=3D1 \ -object memory-backend-ram,id=3Dram-node0,size=3D20971520,host-nodes=3D3,p= olicy=3Dpreferred \ -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ --object memory-backend-ram,id=3Dram-node1,size=3D676331520,host-nodes=3D0-= 7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node1,size=3D676331520,host-nodes=3D0-= 3,policy=3Dbind \ -numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ --object memory-backend-ram,id=3Dram-node2,size=3D24578621440,host-nodes=3D= 1-2,host-nodes=3D5,host-nodes=3D7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node2,size=3D24578621440,host-nodes=3D= 0,host-nodes=3D2,policy=3Dbind \ -numa node,nodeid=3D2,cpus=3D28,cpus=3D30-31,memdev=3Dram-node2 \ -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ -display none \ diff --git a/tests/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args b/te= sts/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args index 0ef1fbfbca..982df0b569 100644 --- a/tests/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args +++ b/tests/qemuxml2argvdata/numatune-memnode.x86_64-5.2.0.args @@ -18,9 +18,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st/.config \ -smp 32,sockets=3D32,cores=3D1,threads=3D1 \ -object memory-backend-ram,id=3Dram-node0,size=3D20971520,host-nodes=3D3,p= olicy=3Dpreferred \ -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ --object memory-backend-ram,id=3Dram-node1,size=3D676331520,host-nodes=3D0-= 7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node1,size=3D676331520,host-nodes=3D0-= 3,policy=3Dbind \ -numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ --object memory-backend-ram,id=3Dram-node2,size=3D24578621440,host-nodes=3D= 1-2,host-nodes=3D5,host-nodes=3D7,policy=3Dbind \ +-object memory-backend-ram,id=3Dram-node2,size=3D24578621440,host-nodes=3D= 0,host-nodes=3D2,policy=3Dbind \ -numa node,nodeid=3D2,cpus=3D28,cpus=3D30-31,memdev=3Dram-node2 \ -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ -display none \ diff --git a/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args b/t= ests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args index 684586b404..087ddf8629 100644 --- a/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args +++ b/tests/qemuxml2argvdata/numatune-memnode.x86_64-latest.args @@ -18,9 +18,9 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st/.config \ -smp 32,sockets=3D32,cores=3D1,threads=3D1 \ -object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":20971520= ,"host-nodes":[3],"policy":"preferred"}' \ -numa node,nodeid=3D0,cpus=3D0,memdev=3Dram-node0 \ --object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":67633152= 0,"host-nodes":[0,1,2,3,4,5,6,7],"policy":"bind"}' \ +-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":67633152= 0,"host-nodes":[0,1,2,3],"policy":"bind"}' \ -numa node,nodeid=3D1,cpus=3D1-27,cpus=3D29,memdev=3Dram-node1 \ --object '{"qom-type":"memory-backend-ram","id":"ram-node2","size":24578621= 440,"host-nodes":[1,2,5,7],"policy":"bind"}' \ +-object '{"qom-type":"memory-backend-ram","id":"ram-node2","size":24578621= 440,"host-nodes":[0,2],"policy":"bind"}' \ -numa node,nodeid=3D2,cpus=3D28,cpus=3D30-31,memdev=3Dram-node2 \ -uuid 9f4b6512-e73a-4a25-93e8-5307802821ce \ -display none \ diff --git a/tests/qemuxml2argvdata/numatune-memnode.xml b/tests/qemuxml2ar= gvdata/numatune-memnode.xml index dd653c5d3b..9640eeb945 100644 --- a/tests/qemuxml2argvdata/numatune-memnode.xml +++ b/tests/qemuxml2argvdata/numatune-memnode.xml @@ -6,8 +6,8 @@ 32 - - + + hvm diff --git a/tests/qemuxml2xmloutdata/numatune-memnode.xml b/tests/qemuxml2= xmloutdata/numatune-memnode.xml index 104d2e6d4c..a117745bfb 100644 --- a/tests/qemuxml2xmloutdata/numatune-memnode.xml +++ b/tests/qemuxml2xmloutdata/numatune-memnode.xml @@ -5,9 +5,9 @@ 24682468 32 - + - + hvm --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1678274110; cv=none; d=zohomail.com; s=zohoarc; b=IKDWcX3CrNLiQ/gxhMl8dUm6k1QNHKqa18LW/OMTfpZqZBAjz99GQ9ljye4d07iXPmuJeHpn6Iz9VY9xHCMewESLvOlHRI2zD7cK2Nq4dWjDQXRDHKJIbt5cBPw6ddTj5TXdkBwuxpj1445cOTSpg4PBI4v4V1OtFAhiIipLuck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274110; 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=nzIkm+a2zgq/VMDu/B1blzGjnnbetTOytSmScjDYuU8=; b=FKf7krApul2aA89N8d1f1VT+4uaw/FR301XzBE8kKlijaEBbu81zu04sjbB0+dtFVt5P7pPCdDBnkDo7InA/kzXRhxcurdNlaE8G51xGZr7+sqZrdYkm48i2jHRHG4wI2hHQJdRXXnjhwIG5mzhSrFSWBf6fyge357snXI7uftk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 16782741099911014.8482492008447; Wed, 8 Mar 2023 03:15:09 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-584-ROcDYF2WMpWxts2mTwG0eg-1; Wed, 08 Mar 2023 06:14:53 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B6711848339; Wed, 8 Mar 2023 11:14:50 +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 1479D440D9; Wed, 8 Mar 2023 11:14: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 C0E6E19465B2; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2FC3A19465B1 for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 266EB1121330; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC3691121314 for ; Wed, 8 Mar 2023 11:14:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274109; 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=nzIkm+a2zgq/VMDu/B1blzGjnnbetTOytSmScjDYuU8=; b=C8uHW+wEfS3BnY9pEz6oxAQQBbyHVelHYWyV3jXhAzGL+lXdCAXgUKc6nLQHB2YQPc+cZF yiJ0EvSQds0YY4c/8y+oB40yxXdwl2N1Duqzsr5PWv6EWAkpLFLG7AVPrA2zzPI19nBr3b BX/qcmYma+Hi9kngWBhlq7odTtlHHFY= X-MC-Unique: ROcDYF2WMpWxts2mTwG0eg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 06/14] qemuxml2argvdata: Extend vCPUs placement in memory-hotplug-dimm-addr.xml Date: Wed, 8 Mar 2023 12:14:33 +0100 Message-Id: <66ef537f1c68f4e62dd77ebeb24c0bef8f976c9d.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.5 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: 1678274112109100001 Content-Type: text/plain; charset="utf-8"; x-default="true" So far, the memory-hotplug-dimm-addr.xml test case pins its vCPUs onto CPUs 0-1 which correspond to NUMA node #0 (per tests/vircaps2xmldata/linux-basic/system/node/node0). Place vCPUs onto nodes #1 and #2 too so that DIMM device can continue using thread-context after future patches. This configuration, as-is currently, would make QEMU error out anyway. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml | 2 +- .../memory-hotplug-dimm-addr.x86_64-latest.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml b/tests/qe= muxml2argvdata/memory-hotplug-dimm-addr.xml index 92ea679bbe..47486dda0c 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml +++ b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.xml @@ -4,7 +4,7 @@ 1099511627776 7434230 7434230 - 2 + 2 hvm diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-lates= t.xml b/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml index ef671fcfa3..0a32d5491a 100644 --- a/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml +++ b/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml @@ -4,7 +4,7 @@ 1099511627776 7434230 7434230 - 2 + 2 hvm --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274249; cv=none; d=zohomail.com; s=zohoarc; b=kbWsq0psmW/3WxFfLYB6+8omGe9wVfpXNRfVRKcfTSteTOhVxI37vLmM5trx/+yb2kX/BwYmXq7LQ291uMyAAVDSdkDuZ+8ikFKDNKr6MMTrJ4pScA7nElk0FN3UgyyUDlK+bdZonuVYqFr8TpQ9MAxuuDi/4eOwj9vbVz9q3sM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274249; 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=uHJKo9WF8G8TmXjqZUXxrYTh4GhrehE7YXemq17w+Ts=; b=X3YPE1mzWOVnw8xlMBJowMNr4CQxNhgi03pIKBLIEkCbvafLrbvpHNVNxyYmhl4Dzwihqdu9EpjqLuJ1fiPkev7O3d3MV2XdueNCUw9A+y5OiwM/fbrXTYnxWLisWQo3YrKXKlDtLXXRdiB42zSImHWdkvVO1pOyE3uFQKPO5So= 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 1678274249468652.209430393016; Wed, 8 Mar 2023 03:17:29 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-82-OzKDUMBfPWSnCTjbMU49nQ-1; Wed, 08 Mar 2023 06:17:23 -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 C38EA100F919; Wed, 8 Mar 2023 11:17:20 +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 AFB3540C945A; Wed, 8 Mar 2023 11:17:20 +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 9EF3A19465B9; Wed, 8 Mar 2023 11:17:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E922C19465BC for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BF967112132D; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 611B41121314 for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274248; 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=uHJKo9WF8G8TmXjqZUXxrYTh4GhrehE7YXemq17w+Ts=; b=bub5v041speI7nfCBsyrLTNnCJE9WNqqf2P9sqeu0T0ee8lAgUU8rFRhqE5R9JVDPue6eq vhi+mbedK+D6TS1/BpcRxLSmjvqp2GM0wejzeeRK6A17/W02g6e0FrDf3BE/2H6ZFOq4zt A1KsLmzONQUniAK0mfiFF9WxFmlrGV8= X-MC-Unique: OzKDUMBfPWSnCTjbMU49nQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 07/14] qemuxml2argvmock: Drop virNuma* mocks Date: Wed, 8 Mar 2023 12:14:34 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1678274250904100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Since qemuxml2argvtest is now using virnumamock, there's no need for qemuxml2argvmock to offer reimplementation of virNuma*() functions. Also, the comment about CLang and FreeBSD (introduced in v4.3.0-40-g77ac204d14) is no longer true. Looks like noinline attribute was the missing culprit. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: Kristina Hanicova --- src/util/virnuma.h | 2 +- ...-unavailable-restrictive.x86_64-latest.err | 2 +- ...mnode-unavailable-strict.x86_64-latest.err | 2 +- ...umatune-static-nodeset-exceed-hostnode.err | 2 +- tests/qemuxml2argvmock.c | 41 ------------------- 5 files changed, 4 insertions(+), 45 deletions(-) diff --git a/src/util/virnuma.h b/src/util/virnuma.h index 21b3efee6d..f131017f85 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -32,7 +32,7 @@ int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mod= e, virBitmap *nodeset); =20 virBitmap *virNumaGetHostMemoryNodeset(void); -bool virNumaNodesetIsAvailable(virBitmap *nodeset) G_NO_INLINE; +bool virNumaNodesetIsAvailable(virBitmap *nodeset); bool virNumaIsAvailable(void) G_NO_INLINE; int virNumaGetMaxNode(void) G_NO_INLINE; bool virNumaNodeIsAvailable(int node) G_NO_INLINE; diff --git a/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictiv= e.x86_64-latest.err b/tests/qemuxml2argvdata/numatune-memnode-unavailable-r= estrictive.x86_64-latest.err index a826c3cdeb..f872dd7e92 100644 --- a/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_6= 4-latest.err +++ b/tests/qemuxml2argvdata/numatune-memnode-unavailable-restrictive.x86_6= 4-latest.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 999 +unsupported configuration: NUMA node 999 is unavailable diff --git a/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86= _64-latest.err b/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict= .x86_64-latest.err index a826c3cdeb..f872dd7e92 100644 --- a/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-lat= est.err +++ b/tests/qemuxml2argvdata/numatune-memnode-unavailable-strict.x86_64-lat= est.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 999 +unsupported configuration: NUMA node 999 is unavailable diff --git a/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode= .err b/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err index b6b98775ee..2a33ccd791 100644 --- a/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err +++ b/tests/qemuxml2argvdata/numatune-static-nodeset-exceed-hostnode.err @@ -1 +1 @@ -internal error: Mock: no numa node set is available at bit 8 +unsupported configuration: NUMA node 4 is unavailable diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 85bd76c315..7169e4ca3a 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -56,47 +56,6 @@ GDateTime *g_date_time_new_now_local(void) return g_date_time_new_from_unix_local(1234567890); } =20 -bool -virNumaIsAvailable(void) -{ - return true; -} - -int -virNumaGetMaxNode(void) -{ - return 7; -} - -/* We shouldn't need to mock virNumaNodeIsAvailable() and *definitely* not - * virNumaNodesetIsAvailable(), but it seems to be the only way to get - * mocking to work with Clang on FreeBSD, so keep these duplicates around - * until we figure out a cleaner solution */ -bool -virNumaNodeIsAvailable(int node) -{ - return node >=3D 0 && node <=3D virNumaGetMaxNode(); -} - -bool -virNumaNodesetIsAvailable(virBitmap *nodeset) -{ - ssize_t bit =3D -1; - - if (!nodeset) - return true; - - while ((bit =3D virBitmapNextSetBit(nodeset, bit)) >=3D 0) { - if (virNumaNodeIsAvailable(bit)) - continue; - - virReportError(VIR_ERR_INTERNAL_ERROR, - "Mock: no numa node set is available at bit %zd", b= it); - return false; - } - - return true; -} =20 char * virTPMCreateCancelPath(const char *devpath) --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274106; cv=none; d=zohomail.com; s=zohoarc; b=N0SI6xiT+UdYbyRRsuQ1GVJ9ZA5Ak2WnVKtfYOZxA7CEI1g+bZ3j8SsH40/oWXQQ1+JO0xbgVNGAHiwnxXc7htclxxgiOgtNmqU+ReJf32hUnscnUKCKwcxsq5ikB/Ud5kBTje6fNGrE1/unbWw55JllwkTqd600Ye6ZUpbBQ7Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274106; 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=JVW6YIcDVva8RkATlxZJPiOu2F2VYKXGkfmJ9R2D/aw=; b=K58xYBogn2i2xpCDZLzOPe328VwHp0+Snpq/aA6ZXk1aiX8j6rmuVumJq8/29bI5/94RS1Taeda8zMmpjXUy6lp/mcYOBYz2Tm66vdB5SHOhKVJgI6eaRSbX74zsDw3p1UXKK2+WTKczgbIIpOnJX3x9IsjZqIkWnyBpCa3UloQ= 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 1678274106612809.3447645016993; Wed, 8 Mar 2023 03:15:06 -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-652-oIXuIWJ1P4y8_ZTzBkQG7Q-1; Wed, 08 Mar 2023 06:14:52 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5C5D53C0F237; Wed, 8 Mar 2023 11:14:50 +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 33F3A1402646; Wed, 8 Mar 2023 11:14:50 +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 0BB7819465B3; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8C21119465B1 for ; Wed, 8 Mar 2023 11:14:48 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 632F11121330; Wed, 8 Mar 2023 11:14:48 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05ECA112132D for ; Wed, 8 Mar 2023 11:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274105; 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=JVW6YIcDVva8RkATlxZJPiOu2F2VYKXGkfmJ9R2D/aw=; b=YcxnnhC/QibLiEO1I4Z7bBy7mTPW/PBZheNjijaNwcLIjh+KRVcAPbHAoNPchuz8pUhBRc hbb+TbxwcIkaMz+GoolsUd2fpt6Cmp126ZSakNUXayw8r/obbNQh/SW3zA4oUGflQOEfQe mljZxuD0xUjP9oIpSHLadZX71mLg8e8= X-MC-Unique: oIXuIWJ1P4y8_ZTzBkQG7Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 08/14] qemu: Move cpuset preference evaluation into a separate function Date: Wed, 8 Mar 2023 12:14:35 +0100 Message-Id: <396008fc7b71e0c8868c3203ab53c79c5d484c7a.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.7 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: 1678274108107100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The set of if()-s that determines the preference in cpumask used for setting things like emulatorpin, vcpupin, etc. is going to be re-used. Separate it out into a function. You may think that this changes behaviour, but qemuProcessPrepareDomainNUMAPlacement() ensures that priv->autoCpuset is set for VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 18 ++++++++++++++++++ src/qemu/qemu_domain.h | 5 +++++ src/qemu/qemu_process.c | 9 ++------- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index aa567f652a..f99a9614e9 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -12442,3 +12442,21 @@ qemuDomainStartupCleanup(virDomainObj *vm) for (i =3D 0; i < vm->def->ndisks; i++) qemuDomainCleanupStorageSourceFD(vm->def->disks[i]->src); } + + +virBitmap * +qemuDomainEvaluateCPUMask(const virDomainDef *def, + virBitmap *cpumask, + virBitmap *autoCpuset) +{ + if (cpumask) { + return cpumask; + } else if (autoCpuset && + def->placement_mode =3D=3D VIR_DOMAIN_CPU_PLACEMENT_MODE_AU= TO) { + return autoCpuset; + } else if (def->cpumask) { + return def->cpumask; + } + + return NULL; +} diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 550397ee50..5ca5fa416c 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1132,3 +1132,8 @@ qemuDomainSchedCoreStart(virQEMUDriverConfig *cfg, =20 void qemuDomainSchedCoreStop(qemuDomainObjPrivate *priv); + +virBitmap * +qemuDomainEvaluateCPUMask(const virDomainDef *def, + virBitmap *cpumask, + virBitmap *autoCpuset); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 9a612ca443..2f6378b549 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -2571,13 +2571,8 @@ qemuProcessSetupPid(virDomainObj *vm, } =20 /* Infer which cpumask shall be used. */ - if (cpumask) { - use_cpumask =3D cpumask; - } else if (vm->def->placement_mode =3D=3D VIR_DOMAIN_CPU_PLACEMENT_MOD= E_AUTO) { - use_cpumask =3D priv->autoCpuset; - } else if (vm->def->cpumask) { - use_cpumask =3D vm->def->cpumask; - } else { + if (!(use_cpumask =3D qemuDomainEvaluateCPUMask(vm->def, + cpumask, priv->autoCpuse= t))) { /* You may think this is redundant, but we can't assume libvirtd * itself is running on all pCPUs, so we need to explicitly set * the spawned QEMU instance to all pCPUs if no map is given in --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1678274283; cv=none; d=zohomail.com; s=zohoarc; b=kpcpdv5LHlwm6gIjKztReYMwdexjlL5vR4OoFIag0aTZgPvNXY1JWQYWHZvTBb3R+kSY01gNnoH9FBS1YGSPOnAMxZ1p6YfdvkSMThwuHyaBmWNKVxW9+BWhyVonRgx1oiM5MOERfARpB6WQi/dePCh5KaSUd36TjKf8PgCppRM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274283; 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=H8Hkx7SnMNMr+xzqEaDK52rtmXwMtZHFCQW4D7gzBug=; b=Jl53gUQdnUWKh8789TTBIdIitp3uU2L7z7TcaH8Ag20fjzJO2yQlTsQzTnYjakItSllEpdBOBt5RDQsAOqbU79ibPBH9y7VB7WQPgIefPJYXkyABTzV5/E/hJclHjOAmVG7ySKhu/oCq3IaFfwbjrdn23RUsOo4EjrOHjkJ6rh0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1678274283814672.129504033234; Wed, 8 Mar 2023 03:18:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-XGhB3_D6Og6yIzQM87PtGQ-1; Wed, 08 Mar 2023 06:17:22 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1FD61802C18; Wed, 8 Mar 2023 11:17:20 +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 08392112132D; Wed, 8 Mar 2023 11:17:20 +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 AAC551946A44; Wed, 8 Mar 2023 11:17:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2261019465B1 for ; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 087EB1121331; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E535112132D for ; Wed, 8 Mar 2023 11:14:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274282; 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=H8Hkx7SnMNMr+xzqEaDK52rtmXwMtZHFCQW4D7gzBug=; b=fg+Rn8WKTBcskLhvF1y1BNydwvSCYRGP7wRJnevswbbtC0hxU8MmxoElc4h8BsgV6NYwuU WtXpinDlYO3q/T2V+hLh29FzoF6NNO4a6cLLK5O1+/EgVnRPxDAwxxrSG2Hfl3NJbfFZek m7XI5uNgP/XpWGQrAaFXr1vi8sLaFqk= X-MC-Unique: XGhB3_D6Og6yIzQM87PtGQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 09/14] qemu: Fix qemuDomainGetEmulatorPinInfo() Date: Wed, 8 Mar 2023 12:14:36 +0100 Message-Id: <375ee4ad94136997f4b7cc3865c43766333d19af.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.3 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: 1678274285015100001 Content-Type: text/plain; charset="utf-8"; x-default="true" The order of pinning priority (at least for emulator thread) was set by v1.2.15-rc1~58 (for cgroup code). But later, when automatic placement was implemented into qemuDomainGetEmulatorPinInfo(), the priority was not honored. Now that we have this priority code in a separate function, we can just call that and avoid this type of error. Fixes: 776924e37649f2d47acd805746d5fd9325212ea5 Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_driver.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c546e35953..0a6f96e68c 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4574,14 +4574,9 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, if (live) autoCpuset =3D QEMU_DOMAIN_PRIVATE(vm)->autoCpuset; =20 - if (def->cputune.emulatorpin) { - cpumask =3D def->cputune.emulatorpin; - } else if (def->cpumask) { - cpumask =3D def->cpumask; - } else if (vm->def->placement_mode =3D=3D VIR_DOMAIN_CPU_PLACEMENT_MOD= E_AUTO && - autoCpuset) { - cpumask =3D autoCpuset; - } else { + if (!(cpumask =3D qemuDomainEvaluateCPUMask(def, + def->cputune.emulatorpin, + autoCpuset))) { if (!(bitmap =3D virHostCPUGetAvailableCPUsBitmap())) goto cleanup; cpumask =3D bitmap; --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274235; cv=none; d=zohomail.com; s=zohoarc; b=JFumD36zhGQsMlD9LRu0Q6vG3X/X5G//1CwxAhrmA9zEwSgqnMn0zZlBQheDggQ5ePQkvWxIrcL+d00e7iT9o5A+mIshPVeEO9vwuUN5yfqB98WQoQnencigz1SM4DXMUlMpiWI8m+wpncHcNnC1Bnqgbg0f33hVkhdGQGPoxIw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274235; 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=WuDdiDQESljgfIFK/C1rvAJfGTcgxu4UvJ5nklhn/7E=; b=On1kcCsTiDfJJi/Vk+YJ9QbVSWIIZKlToNNE3nhQg/RYHGNB4pzCqQOBQwEoIGUYnn6TAwhmPVDeuVRuJbYvZAyPy+P4Nk4UXDelWCZMVzWOsl+6p0f773Tbf15YUw2oSupg+ZZjOT7qSdDvUcmQMTobzO6ysTAXQQnIc/O5EkY= 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 1678274235190391.4835355576614; Wed, 8 Mar 2023 03:17:15 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-643-yq4ow3e7MDCSEFzER0C3Fg-1; Wed, 08 Mar 2023 06:16:35 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F06F8027FD; Wed, 8 Mar 2023 11:16:32 +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 0B8C6492C3E; Wed, 8 Mar 2023 11:16:32 +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 DDF6519465B2; Wed, 8 Mar 2023 11:16:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BCDE819465B1 for ; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A28F21121314; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43CB4112132D for ; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274234; 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=WuDdiDQESljgfIFK/C1rvAJfGTcgxu4UvJ5nklhn/7E=; b=YA46+UNZWu3M1ZEOqoMuh1x5NnaetQc7p5UuqJWKgyz3nta/cEdmayuAML+/uKqPyJJbph Agy7J3WTZZKzAa+jUnTsVQTwcwOCy6cvRJNE3l6LVAwKgRcxiOPKUP1aZGMJoRY3yV3NS8 UJpywdAeYx8O93oGjVYyRQJWwPTJRZ8= X-MC-Unique: yq4ow3e7MDCSEFzER0C3Fg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 10/14] qemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps() Date: Wed, 8 Mar 2023 12:14:37 +0100 Message-Id: <3a976221b6e60aeb240daa010573ef52e83edd1b.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.10 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: 1678274236769100001 Content-Type: text/plain; charset="utf-8"; x-default="true" While it's true that anybody who's interested in getting .host-nodes attribute value can just use virJSONValueObjectGetArray() (and that's exactly what qemuBuildThreadContextProps() is doing, btw), it somebody is interested in getting the actual virBitmap, they would have to parse the JSON array. Instead, introduce an argument to qemuBuildMemoryBackendProps() which is set to corresponding value used when formatting the attribute. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_command.c | 40 ++++++++++++++++++++++++---------------- src/qemu/qemu_command.h | 4 +++- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 7adcac418f..1b58171287 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3240,6 +3240,7 @@ qemuBuildMemoryGetPagesize(virQEMUDriverConfig *cfg, * @def: domain definition object * @mem: memory definition object * @force: forcibly use one of the backends + * @nodemaskRet: [out] bitmap used to format .host-nodes attribute * * Creates a configuration object that represents memory backend of given = guest * NUMA node (domain @def and @mem). Use @priv->autoNodeset to fine tune t= he @@ -3264,7 +3265,8 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPro= ps, const virDomainDef *def, const virDomainMemoryDef *mem, bool force, - bool systemMemory) + bool systemMemory, + virBitmap **nodemaskRet) { const char *backendType =3D "memory-backend-file"; virDomainNumatuneMemMode mode; @@ -3437,19 +3439,24 @@ qemuBuildMemoryBackendProps(virJSONValue **backendP= rops, return -1; } =20 - /* Make sure the requested nodeset is sensible */ - if (nodemask && !virNumaNodesetIsAvailable(nodemask)) - return -1; - - /* If mode is "restrictive", we should only use cgroups setting allowe= d memory - * nodes, and skip passing the host-nodes and policy parameters to QEM= U command - * line which means we will use system default memory policy. */ - if (nodemask && mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { - if (virJSONValueObjectAdd(&props, - "m:host-nodes", nodemask, - "S:policy", qemuNumaPolicyTypeToString(m= ode), - NULL) < 0) + if (nodemask) { + /* Make sure the requested nodeset is sensible */ + if (!virNumaNodesetIsAvailable(nodemask)) return -1; + + /* If mode is "restrictive", we should only use cgroups setting al= lowed memory + * nodes, and skip passing the host-nodes and policy parameters to= QEMU command + * line which means we will use system default memory policy. */ + if (mode !=3D VIR_DOMAIN_NUMATUNE_MEM_RESTRICTIVE) { + if (virJSONValueObjectAdd(&props, + "m:host-nodes", nodemask, + "S:policy", qemuNumaPolicyTypeToStri= ng(mode), + NULL) < 0) + return -1; + + if (nodemaskRet) + *nodemaskRet =3D nodemask; + } } =20 /* If none of the following is requested... */ @@ -3502,7 +3509,8 @@ qemuBuildMemoryCellBackendProps(virDomainDef *def, mem.targetNode =3D cell; mem.info.alias =3D alias; =20 - return qemuBuildMemoryBackendProps(props, alias, cfg, priv, def, &mem,= false, false); + return qemuBuildMemoryBackendProps(props, alias, cfg, priv, + def, &mem, false, false, NULL); } =20 =20 @@ -3526,7 +3534,7 @@ qemuBuildMemoryDimmBackendStr(virCommand *cmd, alias =3D g_strdup_printf("mem%s", mem->info.alias); =20 if (qemuBuildMemoryBackendProps(&props, alias, cfg, - priv, def, mem, true, false) < 0) + priv, def, mem, true, false, NULL) < 0) return -1; =20 if (qemuBuildThreadContextProps(&tcProps, &props, priv) < 0) @@ -7150,7 +7158,7 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virComman= d *cmd, mem.info.alias =3D (char *) defaultRAMid; =20 if (qemuBuildMemoryBackendProps(&props, defaultRAMid, cfg, - priv, def, &mem, false, true) < 0) + priv, def, &mem, false, true, NULL) < = 0) return -1; =20 if (qemuBuildThreadContextProps(&tcProps, &props, priv) < 0) diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index c49096a057..9074822bc5 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -22,6 +22,7 @@ #pragma once =20 #include "domain_conf.h" +#include "virbitmap.h" #include "vircommand.h" #include "virenum.h" #include "qemu_block.h" @@ -140,7 +141,8 @@ int qemuBuildMemoryBackendProps(virJSONValue **backendP= rops, const virDomainDef *def, const virDomainMemoryDef *mem, bool force, - bool systemMemory); + bool systemMemory, + virBitmap **nodemaskRet); =20 virJSONValue * qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg, diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index da17525824..b9f6a031de 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -2280,7 +2280,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver, goto cleanup; =20 if (qemuBuildMemoryBackendProps(&props, objalias, cfg, - priv, vm->def, mem, true, false) < 0) + priv, vm->def, mem, true, false, NULL)= < 0) goto cleanup; =20 if (qemuProcessBuildDestroyMemoryPaths(driver, vm, mem, true) < 0) --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274239; cv=none; d=zohomail.com; s=zohoarc; b=GiGtcBYsFgmETs53cUKbP23mTXRQHfX9rfWovjtGrjFHV+lPBsLguKnakCW1uTHh3RO9zcwvBUrLClW+c1kaR9fjVK3MZt1MuFCxdbJq/of5I80XKgGKbvnEbH6n+fbwoa1yWGRTZfU/1l8IvhHQ9M8sYH8MdISTBD9koI625Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274239; 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=JerotWkck3IKpevrsAFMCtG1rhwArJXf394p2/X8YXk=; b=ApuMVnLDsv4OFwjHsgog1yuuLe5+PL6psPBQc5q/JyYNwnEbKiOP4r80sg+MbT/2gultHdVu+FPwZwDHccwqlaCy4x/l3qrryahFmBgbRvquB/6r3uGDqhT20S5w2tnUVYuoqPPxix7GnnY4p8vKbu8qhRrnMCcXxQUKQf6uS9M= 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 1678274239946121.75420839309129; Wed, 8 Mar 2023 03:17:19 -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-472-7Bh15lmJPqWz3RuMwotAuw-1; Wed, 08 Mar 2023 06:17:13 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 745FE293248F; Wed, 8 Mar 2023 11:17:11 +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 5D5611121314; Wed, 8 Mar 2023 11:17:11 +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 3793419465B2; Wed, 8 Mar 2023 11:17:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 52F491946A43 for ; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 472B91121331; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD62E1121314 for ; Wed, 8 Mar 2023 11:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274238; 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=JerotWkck3IKpevrsAFMCtG1rhwArJXf394p2/X8YXk=; b=Di+M05WtXeqzNUFeL+LBMrnm00mrmzROcp2h62/Z+KFk24XB8s+gxRe5Xd1+jKhvmsUneB DNJsnX0Oapw7KAURoTAqtTk3MLLwd4XBl4ItsYBThWoaPvXAhpe4Au12F1uLea9NW0LLrW 6wYcM5yMXswBIsnwFS53OYx8YD6mhUM= X-MC-Unique: 7Bh15lmJPqWz3RuMwotAuw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 11/14] qemu: Add @nodemask argument to qemuBuildThreadContextProps() Date: Wed, 8 Mar 2023 12:14:38 +0100 Message-Id: <091da4d966a73092c9ea9931d508206d48214e10.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.3 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: 1678274240792100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When building a thread-context object (inside of qemuBuildThreadContextProps()) we look at given memory-backend-* object and look for .host-nodes attribute. This works, as long as we need to just copy the attribute value into another thread-context attribute. But soon we will need to adjust it. That's the point where having the value in virBitmap comes handy. Utilize the previous commit, which made qemuBuildMemoryBackendProps() set the argument and pass it into qemuBuildThreadContextProps(). Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c | 38 +++++++++++++++++++++----------------- src/qemu/qemu_command.h | 3 ++- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 1b58171287..b274ab6ff8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3496,7 +3496,8 @@ qemuBuildMemoryCellBackendProps(virDomainDef *def, virQEMUDriverConfig *cfg, size_t cell, qemuDomainObjPrivate *priv, - virJSONValue **props) + virJSONValue **props, + virBitmap **nodemask) { g_autofree char *alias =3D NULL; virDomainMemoryDef mem =3D { 0 }; @@ -3509,8 +3510,8 @@ qemuBuildMemoryCellBackendProps(virDomainDef *def, mem.targetNode =3D cell; mem.info.alias =3D alias; =20 - return qemuBuildMemoryBackendProps(props, alias, cfg, priv, - def, &mem, false, false, NULL); + return qemuBuildMemoryBackendProps(props, alias, cfg, priv, def, + &mem, false, false, nodemask); } =20 =20 @@ -3523,6 +3524,7 @@ qemuBuildMemoryDimmBackendStr(virCommand *cmd, { g_autoptr(virJSONValue) props =3D NULL; g_autoptr(virJSONValue) tcProps =3D NULL; + virBitmap *nodemask =3D NULL; g_autofree char *alias =3D NULL; =20 if (!mem->info.alias) { @@ -3533,11 +3535,11 @@ qemuBuildMemoryDimmBackendStr(virCommand *cmd, =20 alias =3D g_strdup_printf("mem%s", mem->info.alias); =20 - if (qemuBuildMemoryBackendProps(&props, alias, cfg, - priv, def, mem, true, false, NULL) < 0) + if (qemuBuildMemoryBackendProps(&props, alias, cfg, priv, + def, mem, true, false, &nodemask) < 0) return -1; =20 - if (qemuBuildThreadContextProps(&tcProps, &props, priv) < 0) + if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0) return -1; =20 if (tcProps && @@ -3634,11 +3636,10 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg, int qemuBuildThreadContextProps(virJSONValue **tcProps, virJSONValue **memProps, - qemuDomainObjPrivate *priv) + qemuDomainObjPrivate *priv, + virBitmap *nodemask) { g_autoptr(virJSONValue) props =3D NULL; - virJSONValue *nodemask =3D NULL; - g_autoptr(virJSONValue) nodemaskCopy =3D NULL; g_autofree char *tcAlias =3D NULL; const char *memalias =3D NULL; bool prealloc =3D false; @@ -3648,7 +3649,6 @@ qemuBuildThreadContextProps(virJSONValue **tcProps, if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_THREAD_CONTEXT)) return 0; =20 - nodemask =3D virJSONValueObjectGetArray(*memProps, "host-nodes"); if (!nodemask) return 0; =20 @@ -3664,12 +3664,11 @@ qemuBuildThreadContextProps(virJSONValue **tcProps, } =20 tcAlias =3D g_strdup_printf("tc-%s", memalias); - nodemaskCopy =3D virJSONValueCopy(nodemask); =20 if (virJSONValueObjectAdd(&props, "s:qom-type", "thread-context", "s:id", tcAlias, - "a:node-affinity", &nodemaskCopy, + "m:node-affinity", nodemask, NULL) < 0) return -1; =20 @@ -7151,17 +7150,18 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virComm= and *cmd, g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(priv->dr= iver); g_autoptr(virJSONValue) props =3D NULL; g_autoptr(virJSONValue) tcProps =3D NULL; + virBitmap *nodemask =3D NULL; virDomainMemoryDef mem =3D { 0 }; =20 mem.size =3D virDomainDefGetMemoryInitial(def); mem.targetNode =3D -1; mem.info.alias =3D (char *) defaultRAMid; =20 - if (qemuBuildMemoryBackendProps(&props, defaultRAMid, cfg, - priv, def, &mem, false, true, NULL) < = 0) + if (qemuBuildMemoryBackendProps(&props, defaultRAMid, cfg, priv, + def, &mem, false, true, &nodemask) < 0) return -1; =20 - if (qemuBuildThreadContextProps(&tcProps, &props, priv) < 0) + if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0) return -1; =20 if (tcProps && @@ -7432,6 +7432,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, virQEMUCaps *qemuCaps =3D priv->qemuCaps; g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; virJSONValue **nodeBackends =3D NULL; + g_autofree virBitmap **nodemask =3D NULL; bool needBackend =3D false; bool hmat =3D false; int ret =3D -1; @@ -7453,10 +7454,12 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, } =20 nodeBackends =3D g_new0(virJSONValue *, ncells); + nodemask =3D g_new0(virBitmap *, ncells); =20 for (i =3D 0; i < ncells; i++) { if ((rc =3D qemuBuildMemoryCellBackendProps(def, cfg, i, priv, - &nodeBackends[i])) < 0) + &nodeBackends[i], + &nodemask[i])) < 0) goto cleanup; =20 if (rc =3D=3D 0) @@ -7486,7 +7489,8 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, if (needBackend) { g_autoptr(virJSONValue) tcProps =3D NULL; =20 - if (qemuBuildThreadContextProps(&tcProps, &nodeBackends[i], pr= iv) < 0) + if (qemuBuildThreadContextProps(&tcProps, &nodeBackends[i], + priv, nodemask[i]) < 0) goto cleanup; =20 if (tcProps && diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 9074822bc5..17f326d13b 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -153,7 +153,8 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg, int qemuBuildThreadContextProps(virJSONValue **tcProps, virJSONValue **memProps, - qemuDomainObjPrivate *priv); + qemuDomainObjPrivate *priv, + virBitmap *nodemask); =20 /* Current, best practice */ virJSONValue * --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274180; cv=none; d=zohomail.com; s=zohoarc; b=Fe8cPvvSe8k4/SMNzjz5wuEX+MN0kVjINEedbmeC9C0DrUM9Ia8DDx2NbGgZQOw+5sLtDU2NXupRduc0e924vYH37POH9d35Xr3iTUiz6nDw5ZX+Bii/k9QcRcJEnmSRElSn19I6ooXk1Z5Ke30Eg4bpiDJs2CzPYALZbN8MRtY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274180; 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=Ux82tbKyQjzWdWBfoHUdPnMHLB6V3p+tRRegd9kxVEU=; b=eqcEAmSss6I04GdjIFMycn5mFU2L0SWtYwdvhBDyXTE1zDaiDGl4Z17j+lycKfcENVieB/NGWg2m/yyLeBIAGzuEyz3WO1TeMT5Ns94TZw+Vit+ZhAEaVApWizt3AYW6FNe5PsrQalUu6x0SEy0ddw0IqWi7adXD1rzxRzK5Kv0= 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 1678274180447623.6080522869846; Wed, 8 Mar 2023 03:16:20 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-NRn4qEMlNLSm8W7ZpqxD_Q-1; Wed, 08 Mar 2023 06:16:18 -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 23DC58041BF; Wed, 8 Mar 2023 11:16:16 +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 0D65540C1106; Wed, 8 Mar 2023 11:16:16 +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 A0C8919466DF; Wed, 8 Mar 2023 11:16:15 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ECC6A19465B1 for ; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E0D9C1121314; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82B75112132D for ; Wed, 8 Mar 2023 11:14:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274179; 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=Ux82tbKyQjzWdWBfoHUdPnMHLB6V3p+tRRegd9kxVEU=; b=M+rmIo6IbRJb6Z/3s4z86ukpNxRDjFVIzNabxu0ExJte9Wy9QArEb0b9YU/X8IfNabpALL T8SKPnUjnFLyZ5yXX1gktII197d2TsDVoWKKolffnyiCKTtJrO3KplvvZ5kiHbEMCMmjQR 3FtrcF25ONaVqxL9yC7DS6prBTrJP9k= X-MC-Unique: NRn4qEMlNLSm8W7ZpqxD_Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 12/14] qemuBuildThreadContextProps: Prune .node-afinity wrt Date: Wed, 8 Mar 2023 12:14:39 +0100 Message-Id: <59486d480072135ba3b879aac23cb959d6d3d975.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1678274182476100002 Content-Type: text/plain; charset="utf-8"; x-default="true" When a thread-context object is specified on the cmd line, then QEMU spawns a thread and sets its affinity to the list of NUMA nodes specified in .node-affinity attribute. And this works just fine, until the main QEMU thread itself is not restricted. Because of v5.3.0-rc1~18 we restrict the main emulator thread even before QEMU is executed and thus then it tries to set affinity of a thread-context thread, it inevitably fails with: Setting CPU affinity failed: Invalid argument Now, we could lift the pinning temporarily, let QEMU spawn all thread-context threads, and enforce pinning again, but that would require some form of communication with QEMU (maybe -preconfig?). But that would still be wrong, because it would circumvent . Technically speaking, thread-context is an internal implementation detail of QEMU, and if it weren't for it, the main emulator thread would be doing the allocation. Therefore, we should honor the pinning and prune the list of node so that inaccessible ones are dropped. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2154750 Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c | 26 ++++++++++++++++--- src/qemu/qemu_command.h | 1 + ...emory-hotplug-dimm-addr.x86_64-latest.args | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b274ab6ff8..f93be01101 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3539,7 +3539,7 @@ qemuBuildMemoryDimmBackendStr(virCommand *cmd, def, mem, true, false, &nodemask) < 0) return -1; =20 - if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0) + if (qemuBuildThreadContextProps(&tcProps, &props, def, priv, nodemask)= < 0) return -1; =20 if (tcProps && @@ -3636,10 +3636,13 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg, int qemuBuildThreadContextProps(virJSONValue **tcProps, virJSONValue **memProps, + const virDomainDef *def, qemuDomainObjPrivate *priv, virBitmap *nodemask) { g_autoptr(virJSONValue) props =3D NULL; + virBitmap *emulatorpin =3D NULL; + g_autoptr(virBitmap) emulatorNodes =3D NULL; g_autofree char *tcAlias =3D NULL; const char *memalias =3D NULL; bool prealloc =3D false; @@ -3656,6 +3659,23 @@ qemuBuildThreadContextProps(virJSONValue **tcProps, !prealloc) return 0; =20 + emulatorpin =3D qemuDomainEvaluateCPUMask(def, + def->cputune.emulatorpin, + priv->autoNodeset); + + if (emulatorpin && + virNumaIsAvailable()) { + if (virNumaCPUSetToNodeset(&emulatorNodes, emulatorpin) < 0) + return -1; + + virBitmapIntersect(emulatorNodes, nodemask); + + if (virBitmapIsAllClear(emulatorNodes)) + return 0; + + nodemask =3D emulatorNodes; + } + memalias =3D virJSONValueObjectGetString(*memProps, "id"); if (!memalias) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -7161,7 +7181,7 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virComman= d *cmd, def, &mem, false, true, &nodemask) < 0) return -1; =20 - if (qemuBuildThreadContextProps(&tcProps, &props, priv, nodemask) < 0) + if (qemuBuildThreadContextProps(&tcProps, &props, def, priv, nodemask)= < 0) return -1; =20 if (tcProps && @@ -7490,7 +7510,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, g_autoptr(virJSONValue) tcProps =3D NULL; =20 if (qemuBuildThreadContextProps(&tcProps, &nodeBackends[i], - priv, nodemask[i]) < 0) + def, priv, nodemask[i]) < 0) goto cleanup; =20 if (tcProps && diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index 17f326d13b..5fdb138030 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -153,6 +153,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg, int qemuBuildThreadContextProps(virJSONValue **tcProps, virJSONValue **memProps, + const virDomainDef *def, qemuDomainObjPrivate *priv, virBitmap *nodemask); =20 diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.= args b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args index 84360843fb..6ae1fd1b98 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args +++ b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args @@ -28,7 +28,7 @@ XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGue= st1/.config \ -no-shutdown \ -boot strict=3Don \ -device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ --object '{"qom-type":"thread-context","id":"tc-memdimm0","node-affinity":[= 1,2,3]}' \ +-object '{"qom-type":"thread-context","id":"tc-memdimm0","node-affinity":[= 1,2]}' \ -object '{"qom-type":"memory-backend-file","id":"memdimm0","mem-path":"/de= v/hugepages2M/libvirt/qemu/-1-QEMUGuest1","prealloc":true,"size":536870912,= "host-nodes":[1,2,3],"policy":"bind","prealloc-context":"tc-memdimm0"}' \ -device '{"driver":"pc-dimm","node":0,"memdev":"memdimm0","id":"dimm0","sl= ot":0,"addr":4294967296}' \ -object '{"qom-type":"memory-backend-ram","id":"memdimm2","size":536870912= }' \ --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 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=1678274140; cv=none; d=zohomail.com; s=zohoarc; b=FxoI9bvPPy8/O+b7FuOzGjekPmAbsa/zU9YJd9TxyB/1lwQqkfhPG9kOexGyw8/WaBUhk7cImMvYtuFlFFBz5RsRp2GEfhvUgn+eHBoeeGiKjT8Zf+6dUinjGfFabD40LvOFUQn9Jgrp1tXGyzMLoGDtJ6GrLPIP+8ubPnix3vA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274140; 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=cVzHSUGxo8OZQ0Hj91C+Ca6ypyd0DVtsxg3FyCflAfw=; b=Ab2sXLjh0MVHVLMvUgwNMKJnyruLGtSbx/+Uw2xcUqYj+p7R4dvZPh9KethFVG99sIKpMvzjQuQZwdL5lQixEOHE4hq814yp6JT0fMwmapXs6rL9e/Z1mQvmeUCEoBlpnkVQnqc8P02S8BaMXL327suXAjHB1PQuXebXefF5Yug= 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 1678274140463562.4196125998848; Wed, 8 Mar 2023 03:15:40 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-y-RBbbySNyGBybHBr5hnqA-1; Wed, 08 Mar 2023 06:15:32 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 65E0E185A7A4; Wed, 8 Mar 2023 11:15:30 +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 1EBA1492B04; Wed, 8 Mar 2023 11:15:30 +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 0B33819465B2; Wed, 8 Mar 2023 11:15:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8FABA19465B1 for ; Wed, 8 Mar 2023 11:14:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 86454112132D; Wed, 8 Mar 2023 11:14:51 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 281211121314 for ; Wed, 8 Mar 2023 11:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274138; 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=cVzHSUGxo8OZQ0Hj91C+Ca6ypyd0DVtsxg3FyCflAfw=; b=NIJL9c/pP9FWvtzbWJ8fGAQ+w9BwoV+jpjAjYdZKl2s9VkXUziXbb0fCPVQOhFWiP5L/MV Dxt6L/sGXG5nFXWFq/+ltlKr1U4TDkhB02atzM0Nf5oYIeW1kZUMpeA3oemzKWSXyp4713 AbCaheyiRJQlxbRRSYvPrwQYAFgmhRg= X-MC-Unique: y-RBbbySNyGBybHBr5hnqA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 13/14] docs: Document memory allocation and emulator pinning limitation Date: Wed, 8 Mar 2023 12:14:40 +0100 Message-Id: <4e8f7b36fad5a4ddee32b6ca729918ca05636f90.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.9 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: 1678274142274100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- docs/formatdomain.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index c4077c6868..206875d68e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1117,7 +1117,9 @@ influence how virtual memory pages are backed by host= pages. Using the optional ``mode`` attribute, specify when to allocate the mem= ory by supplying either "immediate" or "ondemand". :since:`Since 8.2.0` it is possible to set the number of threads that hypervisor uses to allocate - memory via ``threads`` attribute. + memory via ``threads`` attribute. To speed allocation process up, when + pinning emulator thread it's recommended to include CPUs from desired N= UMA + nodes so that allocation threads can have their affinity set. ``discard`` When set and supported by hypervisor the memory content is discarded ju= st before guest shuts down (or when DIMM module is unplugged). Please note= that --=20 2.39.2 From nobody Sun Nov 10 19:48:42 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1678274101; cv=none; d=zohomail.com; s=zohoarc; b=KTkhrV3KVt0MsdmOneXp7G31K0WmEwup8IA7S4KyrlgxFD2FYvxWomXzh5yNj/VKeHnLvYleailPIPQoG+GhxWHm8ZUQtjJw1la0dl8Ih+Y9gH9jgYKMAI1RxKLrN6SNLJkdG/1BdRQQaft7VS1BfKf0KpIeB3tbC4PXWe+Z8Zw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678274101; 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=qAPfeZM3hVl9ZQxGUWD2e+aTosIJiwJO5oOh9k9fojc=; b=MYOwoZ2+ZdqSM66c0OBPMbMBD8lYhfJU5HVdXTb+DgBA6dZccNXM0kjmKVIWnFglJwLHyJ+xwxM80nBlWTuPwm/4M4AbJloYvS1tqH8HF8ZcR9ktfzt0KHMg+1iGEDkSdV3o+Rmfv9criPszLTQq1dXuyjWoJfiO/4a+mjRAXDc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1678274101644549.8395684223669; Wed, 8 Mar 2023 03:15:01 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-7cRxLxIFNQWDtEBxoHQXeA-1; Wed, 08 Mar 2023 06:14:55 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7593A811E9C; Wed, 8 Mar 2023 11:14:53 +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 6269814171B6; Wed, 8 Mar 2023 11:14:53 +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 4828B19465B2; Wed, 8 Mar 2023 11:14:53 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 37D5919465B1 for ; Wed, 8 Mar 2023 11:14:52 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2B1BC1121314; Wed, 8 Mar 2023 11:14:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id C1247112132D for ; Wed, 8 Mar 2023 11:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678274100; 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=qAPfeZM3hVl9ZQxGUWD2e+aTosIJiwJO5oOh9k9fojc=; b=BEe/ccmUCqAsBSOWHPtCyz/m90Vbbvy8Dsm1mgC7zBhx3XT6Y3GbgsfNyW83RDZI9Fx/T3 P8PvrNNjC6A4M2K5WSFFdDXap0PuBf1WvY+Zq3gR5TyLmotWn/+7NKZeDnsN7tHCN1Mzfz JvBFn2MKKxPr4e/JQ1eb8UaVkJc9ScE= X-MC-Unique: 7cRxLxIFNQWDtEBxoHQXeA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 14/14] NEWS: Document recent thread-context bug fix Date: Wed, 8 Mar 2023 12:14:41 +0100 Message-Id: <5e631b5f8ef5d75f341f0a014db789da2d524a36.1678274036.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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.7 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: 1678274102116100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 089ad733f2..29239950c1 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -42,6 +42,13 @@ v9.2.0 (unreleased) Due to a logic bug introduced in libvirt 9.0.0, VM configurations explicitly enabling the HPET timer were rejected. =20 + * qemu: Fix thread-context .host-nodes generation + + With new enough QEMU, libvirt instructs QEMU to set affinity of memory + allocation threads. But this may have resulted in QEMU being unable to= do + so, as affinity to NUMA nodes inaccessible to emulator thread might ha= ve + been requested. + =20 v9.1.0 (2023-03-01) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.39.2