From nobody Tue Apr 16 15:38:24 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=1678812800; cv=none; d=zohomail.com; s=zohoarc; b=jVtICfve+AYYc8m2YupxJt/0rsyVNoaVS2CljjhWmYE14B9NBsYaEhcaATxYGsdQnzVHm1TUQafs9KjVnRjP+v4rX4L+IohjcxdP/RTTlMuDcnPro9tg5x5GqaBab72epUjQQEfGzBJr6mThF10GX/se5eLkv0kBj7zV87DQrV8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812800; 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=a1nhsqwZa1AdpI5/9By3M3ymstblVhElAKNDFW5KRrY=; b=e7SSZVfZEuyQrAp7E9TAgcXqWLNdDSd5daYKCIxYglXh+dK3EOxupYI+JGQoThoYIFWkmYfdYRNhnc8ohaRY6lpPo+eQau72va8QH/p7hv3grsjqRyTtcv+SPtQ2motOcZG94kCgHNcjMuD5rfLynXv+Bzr9THloCEsIDREU9WM= 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 1678812800098564.5915720890248; Tue, 14 Mar 2023 09:53:20 -0700 (PDT) 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-586-HMoVBdznM0C4kkoh5bgwGQ-1; Tue, 14 Mar 2023 12:53:13 -0400 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 DB065384D026; Tue, 14 Mar 2023 16:53:00 +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 C84B040C6E67; Tue, 14 Mar 2023 16:53:00 +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 BB5B119465A2; Tue, 14 Mar 2023 16:53:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A331D19465A0 for ; Tue, 14 Mar 2023 16:52:32 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 01D4F2166B2A; Tue, 14 Mar 2023 16:52:32 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BED72166B26 for ; Tue, 14 Mar 2023 16:52:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812798; 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=a1nhsqwZa1AdpI5/9By3M3ymstblVhElAKNDFW5KRrY=; b=AL5W+tEXgkT0Y5jnR19AEZ5GB9Bv4qgSqMtECQtyyTOW8rjEeqAGnVozi5hMs2L1EUoUGM SAXtuzKauDJyWlJBTpBaxoARF2t2N+ZVHoLHu6hDPexsAGL3uwHfFPjZ5QrM4NQ4/pi4w/ vFJHb2pKGzUT6zIIUlerdnKvMEALmNw= X-MC-Unique: HMoVBdznM0C4kkoh5bgwGQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 01/15] virnuma: Move virNumaNodesetToCPUset() our of WITH_NUMACTL Date: Tue, 14 Mar 2023 17:52:15 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812801960100001 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: Kristina Hanicova Reviewed-by: J=C3=A1n Tomko --- 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 Tue Apr 16 15:38:24 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=1678812790; cv=none; d=zohomail.com; s=zohoarc; b=Td8BcALZP6xiix6RTQNPJAs8AhJS5xdKnTRx7Nfss1UobV/97EouiaXp7lZ/Sh+1z5RMeGmiJB2M+2+lzN3Lsm5hFzQDQRSnSufqSOEC/nAYXfwuRxd5LHxW5gSF77+aRcMm1c/1ch8pv/6fe+jIXuxCrDK66Q/oWP5Vyj0OUhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812790; 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=oRjM/WdtRCl9O6HxPYy9zQ3ie64zOT21T3pPUpJ+lP4=; b=J6Gj2FkD12OFQipHxMb8npvVvwCuO+qiiETWMh2qOtTodRRwP9/Grt19ejNkZ9B6vFVbgppToCmuqNj/L+oEl0T+MKZwizh25FLCT7WMuOlOCG32myNPc++JPW0Ef2a9uNIW+5IdylijO6dXLvDyqY/LLwLyyQjFkzIl27PNUK4= 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 1678812790666522.930159711867; Tue, 14 Mar 2023 09:53:10 -0700 (PDT) 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-58-8JhzNgEgPqiO7jYEk4R9Pw-1; Tue, 14 Mar 2023 12:53:06 -0400 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 BC31F3C11794; Tue, 14 Mar 2023 16:52:59 +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 2FD27140EBF4; Tue, 14 Mar 2023 16:52:59 +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 E521E1946A40; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A344019465A2 for ; Tue, 14 Mar 2023 16:52:37 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 92CA32166B2B; Tue, 14 Mar 2023 16:52:32 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 38DC32166B26 for ; Tue, 14 Mar 2023 16:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812789; 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=oRjM/WdtRCl9O6HxPYy9zQ3ie64zOT21T3pPUpJ+lP4=; b=PBtEOFnbkAicbgXlna4Sdl9pRtg0JbGTOPZZVBpk6xjx4OU4JbOD+7LLuPT+6KC+NjgMwH ZlOhbSvn4OHroYSsOA63xXQIlT7sWrLTwbh0Vd4QiUEA2yRJKwjHOrSgBj5Eu00GWKT12+ 8tOB8TXZS6rC6HtP1zE4Wk8crbkDvUQ= X-MC-Unique: 8JhzNgEgPqiO7jYEk4R9Pw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 02/15] virnuma: Introduce virNumaCPUSetToNodeset() Date: Tue, 14 Mar 2023 17:52:16 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812791921100001 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 Reviewed-by: J=C3=A1n Tomko --- 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 6f44788233..605522c9f6 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -2976,6 +2976,7 @@ virNodeSuspendGetTargetMask; =20 =20 # util/virnuma.h +virNumaCPUSetToNodeset; virNumaGetAutoPlacementAdvice; virNumaGetDistances; virNumaGetHostMemoryNodeset; @@ -2983,6 +2984,7 @@ virNumaGetMaxCPUs; virNumaGetMaxNode; virNumaGetNodeCPUs; virNumaGetNodeMemory; +virNumaGetNodeOfCPU; virNumaGetPageInfo; virNumaGetPages; virNumaIsAvailable; diff --git a/src/util/virnuma.c b/src/util/virnuma.c index dae0827c65..4a15bf32c8 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 +/** + * virNumaCPUSetToNodeset: + * @cpuset: bitmap containing a set of CPUs + * @nodeset: returned bitmap containing a set of NUMA nodes + * + * 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 *cpuset, + virBitmap **nodeset) +{ + 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..2c30ef4e31 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 *cpuset, + virBitmap **nodeset); int virNumaNodesetToCPUset(virBitmap *nodeset, virBitmap **cpuset); =20 --=20 2.39.2 From nobody Tue Apr 16 15:38:24 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=1678812786; cv=none; d=zohomail.com; s=zohoarc; b=JnUzpeBkk3WZ7Q+QcamqaHjCilo4LVEfkh59QTL6iP2klDbyFsrax9Mutd0w1NcGeX0Qh8+e7mMVuy6/6ckj1+NurM28F+d4cn8IQ9o3oXwI2H+o7SDhslSgeKPZ34mwAnMFUU+nbrbMhN4B8DU6yFVoX/W8k81Orn2Xrxd3T4g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812786; 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=3gwTL7QNJDtnqSlXtsJWysb00Mi2VG65S24RSt9uWI4=; b=mq2iaZQH8Rt4yl5VusKVmafmF4ZNapFCIOfe0k3U+zNDQ2lSWu3G+5gCgmalaaysG3D4yXhS5ztyX2nzDPFOEYQ2ps5ooowakk9sVleYgR4MjBnlBu9kELaQgo0YpCHZ+NulkjLAYRVH8SRhkSl112cilDZzoHdVGM0WJoAVJu8= 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 1678812785992439.3366522139286; Tue, 14 Mar 2023 09:53:05 -0700 (PDT) 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-288-QgUqwswYNvWgLxOfC30WSw-1; Tue, 14 Mar 2023 12:53:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1286E2806049; Tue, 14 Mar 2023 16:53:00 +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 F25D9C164E7; Tue, 14 Mar 2023 16:52:59 +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 707F519465A4; Tue, 14 Mar 2023 16:52:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AA42819465A8 for ; Tue, 14 Mar 2023 16:52:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4C3B82166B2D; Tue, 14 Mar 2023 16:52:33 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAF032166B26 for ; Tue, 14 Mar 2023 16:52:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812784; 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=3gwTL7QNJDtnqSlXtsJWysb00Mi2VG65S24RSt9uWI4=; b=WDTQ+L4oqs5PYwsECJApbpXFHEJv7s065sVIGgOr1pXggOhBRkSwQWyNkfs1uftVEhqQSm MMIcvYTxFW5rD0Pvyo/haPXfMKnpsua00aZyhuWcmPUSza/F9VeNoCEo0FnBLKqLtYQ4Xu Gbu5Em+1LKJKOQvDZ2QGMY1KHOEgHKQ= X-MC-Unique: QgUqwswYNvWgLxOfC30WSw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 03/15] virnumamock: Introduce virNumaGetNodeOfCPU() mock Date: Tue, 14 Mar 2023 17:52:17 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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.8 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: 1678812787945100001 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: Kristina Hanicova Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- 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 2c30ef4e31..edd701d5c8 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 *cpuset, virBitmap **nodeset); 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 Tue Apr 16 15:38:24 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=1678813012; cv=none; d=zohomail.com; s=zohoarc; b=m1vgdskKxz9ldGjKA5evV34NCWovO6RabWZaDrNoMxlCG7a8iCRiTNHlOfsRxTf9Ybl9Xf0JOJfhOFu+VOfM/Uaehaz4Kw3d9br/zEkj8wC+1QYWG0LGUsCqhMRdu7wWMs56znnFkzmopFhooaAtmY0w788qEmXUPnDXvTGieiM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678813012; 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=q12b5Kn//29oZYXdjg6NTApOSUo56ndyIq0yg645TZ8=; b=Kyi1tArzpu8aRWxjd6Lfhu9ujPsJBcETvW+UTvq2Mh/k6YSdGG6+muuxQ1oF9W9wf2jCBzXEkSGd0G3SrIVZBOG3GSKuqzg6Ctt67SBDLVTNBriHVkh7beO0pdDpMNLqc2F90Jj3Y0jDj279quC/slzl54ljQTJXKFmnGdP+PUE= 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 1678813012020369.7428009194257; Tue, 14 Mar 2023 09:56:52 -0700 (PDT) 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-578-hCs4JHyLPFWJdWqDEgk0_w-1; Tue, 14 Mar 2023 12:56:43 -0400 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 397203C11799; Tue, 14 Mar 2023 16:53:01 +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 1D7421410F1B; Tue, 14 Mar 2023 16:53:01 +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 014D91946A40; Tue, 14 Mar 2023 16:53:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC3DF19465B1 for ; Tue, 14 Mar 2023 16:52:33 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DD7892166B2E; Tue, 14 Mar 2023 16:52:33 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83CC42166B26 for ; Tue, 14 Mar 2023 16:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678813011; 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=q12b5Kn//29oZYXdjg6NTApOSUo56ndyIq0yg645TZ8=; b=IcNBFMNwGtqWwN42MW8bS4e3dt1Tiquk5Bjp128Fn7ypLRHeVT4z/nXgpwej1llvO8Rzd4 bgPid8VlTjIzuYnhB4xUC2Q8EarZZbYrmfdOIsBAWvqG7cZHfatfdSQh+lTko0hApTjeQ5 BMxc1Xorfembhp9YP1adweyMiEbR6cE= X-MC-Unique: hCs4JHyLPFWJdWqDEgk0_w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 04/15] qemuxml2argvtest: Use virnuma mock Date: Tue, 14 Mar 2023 17:52:18 +0100 Message-Id: <6227d580a90349d801939fd00b22c3d1af0f16d2.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678813013491100001 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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..0fd3bc62cf 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -84,6 +84,7 @@ mock_libs =3D [ { 'name': 'virnetdaemonmock' }, { 'name': 'virnetdevmock' }, { 'name': 'virnetserverclientmock' }, + { 'name': 'virnumamock' }, { 'name': 'virpcimock' }, { 'name': 'virportallocatormock' }, { 'name': 'virprocessmock' }, @@ -94,7 +95,6 @@ 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 c879fa90e0..efecb7c89d 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", @@ -2911,7 +2913,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 Tue Apr 16 15:38:24 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=1678812816; cv=none; d=zohomail.com; s=zohoarc; b=FDXk6u3c/VZtNwp3jGTBkjfBLTUBDNAmzlNgehkYhIJ/mn5cx01nvYfjuVS5iHvSg+t/CGX2il0rs1fQ78paRqc4WpqixJARjCWzrqhKKZFAVJZRRCaMZ/LHZa+wS12QgrZnbt5DQRUwe2Vrs49/nt2FElUy4lPS6/WwFwZ1Gos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812816; 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=jLHBFFkGhrIDyWLLHtMdh7JcFWy2TW0VcHCE8LlJVw4=; b=EqOCUw/OW4DveVA9p5YXwZDquFtsZUK7WCObECxWTZAZairwY5q9mQryg+ZBW6qTw4cCWQPWDYzTrKtWlsqzMiZ1GHSx7hq7ZJt2E6Zd0Rr2FMeNrlIv7HqXt8S9Pu2JFZRcxYADMlt8jK9TDlO3f+fR72YLL6tDEmyhaHvAeqo= 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 1678812816722811.0828126977963; Tue, 14 Mar 2023 09:53:36 -0700 (PDT) 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-422-qI0ug05eNp608bTph9yDsQ-1; Tue, 14 Mar 2023 12:53:30 -0400 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 5523F1C0896B; Tue, 14 Mar 2023 16:53:13 +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 3EDB32166B30; Tue, 14 Mar 2023 16:53:13 +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 0C19E1946A63; Tue, 14 Mar 2023 16:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C3A2E19465B9 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7ACF12166B2F; Tue, 14 Mar 2023 16:52:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20E982166B26 for ; Tue, 14 Mar 2023 16:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812815; 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=jLHBFFkGhrIDyWLLHtMdh7JcFWy2TW0VcHCE8LlJVw4=; b=Nbio1DFybkhAwmM2JCgBWcqVvJMkeSaGIvgwDx7j1aafnTy8xYw/bLsXjYQ0dkYx/37wZ6 OKlLym1FuoVe+7YbZEJNfS041lFJu9b84cgw0IGgzQxspfu4QDZhnmfeAVvy69ZwBYl2zx FTdNIBp2zCbWjqwQAy7d1P58z6k/KTI= X-MC-Unique: qI0ug05eNp608bTph9yDsQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 05/15] qemuxml2argvdata: Adjust maximum NUMA node used Date: Tue, 14 Mar 2023 17:52:19 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812818165100004 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 Tue Apr 16 15:38:24 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=1678812796; cv=none; d=zohomail.com; s=zohoarc; b=iiH74vOFZIIbOpEFfJrUtjIdmYbXNrZUWtgJMV4Xu4iYcaiPwAWlRF10Bby1txE8h1NIMR/2cTSzoxNolf3K4HsMMuFtV5YM6ndx7fTKnudVvisybQZk3S8+3fFHdNYQ7o7e0xDaSv+T08DnyciyAViH04GytiaO7pv0OYMGeRA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812796; 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=bnc5HiFjkb0520Tnk0ZlQEcM0K9sQ1W2jlvDe1PCLTg=; b=BPYLSuSKchUqnM149ontd5nffIF1qMQ78df/Bm8ctH3n/XYdCBDym+IvbpDN7HgfEGdZju0YhRdi1jlQzQmrsO5iiCsW7vVyGGyveuSfRgw07IL8UaXPWS0/bndZJ1zrIQWNxnRR+cfaSY/1xslPRykePPZuYpwK2fIS5WdmvKU= 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 1678812796628464.0276907802106; Tue, 14 Mar 2023 09:53:16 -0700 (PDT) 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-652-eBG0suilP3ScFc8UkYmC7w-1; Tue, 14 Mar 2023 12:53:13 -0400 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 4906981156E; Tue, 14 Mar 2023 16:53:07 +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 236A41410F1C; Tue, 14 Mar 2023 16:53:07 +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 815FA1946A6B; Tue, 14 Mar 2023 16:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C370719465B8 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 17E6F2166B31; Tue, 14 Mar 2023 16:52:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B21882166B26 for ; Tue, 14 Mar 2023 16:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812795; 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=bnc5HiFjkb0520Tnk0ZlQEcM0K9sQ1W2jlvDe1PCLTg=; b=QN7xI4jKdIFhv4KbgW3K+nGoVd7c/iijsKtjZKpaA7ez9LWwJ2y9/DbOUDMavy8d/yQ+UL MUao4JFJ9Hr9GD13KBOHvTLgd3W23n1rotggOkFxwnqh9G1g4nX8osPCjRH7c4uZh/6uWj uL+UaSffbJpMBeSPQvKdlI61NNITmWI= X-MC-Unique: eBG0suilP3ScFc8UkYmC7w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 06/15] qemuxml2argvdata: Extend vCPUs placement in memory-hotplug-dimm-addr.xml Date: Tue, 14 Mar 2023 17:52:20 +0100 Message-Id: <2f2640bd94f9992e463cbe533132032112641420.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812797927100001 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 Tue Apr 16 15:38:24 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=1678812842; cv=none; d=zohomail.com; s=zohoarc; b=mGJZc/NMwcIEn4aY7usRedLdCOpBlVI5vRMKgZHQjueRrqQPuSHP9cvl+1jR7dftYd5172R/uJ1OUt8DJovA9Nw3lk+serg99zC35MoZ1EiHWopTCxh6ZTHhc4VhL2v2aDn1Xv+wXSMmKaPmnWMRldLhDjz8uIObw/FH+zWhd6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812842; 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=3GqCbvL4+1BsN35UtoFFyMIZCUOi3/UElyn1sWlbEBs=; b=RxbZbuIqNHKr34XtZSX/b4bDWMflT69F1XInbqb9AfVsxf9dTGlXHZe1ZTefUhRYoQ9PaUG+lb8FdHJuN+CrRbSGp2Z+qT6h1MXMvbwJnGohF5tT/63UZqgMPdgt6bQSEkjF6N5V+ufkEx7Bj4ZJrIK8Qo85kvk/faXSSXaTwjs= 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 1678812842921786.9862145620197; Tue, 14 Mar 2023 09:54:02 -0700 (PDT) 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-633-koV3kDDWNG-M4X9uoczd4g-1; Tue, 14 Mar 2023 12:53:11 -0400 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 3BB012806063; Tue, 14 Mar 2023 16:53:07 +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 1FBC11121318; Tue, 14 Mar 2023 16:53:07 +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 7C4611946A68; Tue, 14 Mar 2023 16:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C320019465B6 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A8DBE2166B30; Tue, 14 Mar 2023 16:52:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F4E12166B26 for ; Tue, 14 Mar 2023 16:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812841; 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=3GqCbvL4+1BsN35UtoFFyMIZCUOi3/UElyn1sWlbEBs=; b=giVTMMA4Rdwa8TYbCjvvvzsRt/Oaw1h6Hovut+3Ufa/0spCs0FXXpfliIxMs+blN2kR7v9 bIN/wZgAhZcvblo60fXxcWDkGkOiBetVNfvhL2G1Y7h6tmQtQhjBMzUb36bwwAX83UpKME z0qMWwU5VA0uGQPZId/0paci1f8Jq6k= X-MC-Unique: koV3kDDWNG-M4X9uoczd4g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 07/15] qemuxml2argvmock: Drop virNuma* mocks Date: Tue, 14 Mar 2023 17:52:21 +0100 Message-Id: <4187cc54303fda25591204aaa60bf6c642b9b579.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812844302100001 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: Kristina Hanicova Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko --- 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 | 42 ------------------- 5 files changed, 4 insertions(+), 46 deletions(-) diff --git a/src/util/virnuma.h b/src/util/virnuma.h index edd701d5c8..475df96e1d 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..f566ec539a 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -30,7 +30,6 @@ #include "virnetdevip.h" #include "virnetdevtap.h" #include "virnetdevopenvswitch.h" -#include "virnuma.h" #include "virscsivhost.h" #include "virtpm.h" #include "virutil.h" @@ -56,47 +55,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 Tue Apr 16 15:38:24 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=1678812845; cv=none; d=zohomail.com; s=zohoarc; b=n8DOOpV3Jrcdp8BU/+17Dchx8Xy5RaLgd8+bapfD0gcQATeWDfrzfqH901UqloHsH8Reg4jL0M5egl2IYPASzcgVQ0k235qztSC9H/P/cvMVbsKvPgZNyGsWo/KAFjtq2M7RpktAHABst7MRY/e23tazPWyAw1rYbmC8Qd8ou0M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812845; 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=E1HqZi0tR5VgUFE3qzBQ9+GOTooDDJ6sHCUlUc7t/0M=; b=fFCtn0qLe4F5nT53CsDMDQ0txX0Vc7RTh8KoN7YLcCNDg7ZD5dUeFY4Utdj7Ay2R7V3CZZ/c4Xsave3/LahLOzrEVZ0VknCp1mBogU5tPbJBiSD2xZIa1HB69N8uqXvuOSP+Cx4z4FozPAtdD+sYTgAEOZCtKg1yHA3V8XJWUT4= 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 16788128452189.180366231177686; Tue, 14 Mar 2023 09:54:05 -0700 (PDT) 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-606-RyQXXNQuOBiMf3WR1gkIUQ-1; Tue, 14 Mar 2023 12:53:12 -0400 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 E4826100F83D; Tue, 14 Mar 2023 16:53:06 +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 BF9FD140EBF4; Tue, 14 Mar 2023 16:53:06 +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 4BAE319465B9; Tue, 14 Mar 2023 16:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C322F19465B7 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 462232166B32; Tue, 14 Mar 2023 16:52:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id E06F42166B26 for ; Tue, 14 Mar 2023 16:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812844; 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=E1HqZi0tR5VgUFE3qzBQ9+GOTooDDJ6sHCUlUc7t/0M=; b=Vty2zuZHyHmQMUW7DihRQeoXYyttU5Tc5vgE4AXERfFDWhtRzjtJSzCE0ajPEoMEZNwxu9 r05jzwoBPYkzv3jzX7g9gVNhgyvu5QrvuoGqiTvZ8g1QOMEVz8poK/FU+MHTfYVDgrbimn nf+9+dgdtCtDUJyH8bxHvX/tRWHnxUU= X-MC-Unique: RyQXXNQuOBiMf3WR1gkIUQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 08/15] qemu: Move cpuset preference evaluation into a separate function Date: Tue, 14 Mar 2023 17:52:22 +0100 Message-Id: <911ce0ca1a492d015e7dc9b3060a58ea7d3f29f5.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812846395100001 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 0feab09bee..3d41d9e90f 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -12451,3 +12451,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 9bcc5e1380..e230e9777b 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1133,3 +1133,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 be418ad8e6..18b7781cbb 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 Tue Apr 16 15:38:24 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=1678812814; cv=none; d=zohomail.com; s=zohoarc; b=LO6/tnAHSJdSN0AtMR7wYHmz4vHjwiExG4V73fX9E5k9xuN30no+0EX7ROwAeGaSPWDLpozuiMfYKVAY/nnyZm/l47jLLQsbPAEOZt6SJjoji45GxTqFMllOuQLRt8KLEDPvpEVfs3sYbBqFfHHPkf85PmcVEwYKWzXtBvAGl7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812814; 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=MSAsvI/ZUduep7EiZCbFtLNx9xa+ycxksJhvH50KY+s=; b=T3jJeJw81526Fl2diVjas0JEKsk208etjG6H1yDPNkRDZ16QBw/dYUyZWFtjgRJebu8JTZ06Lql8FPTky4wm6tP2ozKllJp9NfbtdAC9cKl6tGBP+N7TONdPgNEkZ0YbIUNC7T/0ZTje71CpRyAYElbbXQuthO9lrt5t6iOMQdY= 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 1678812814226372.33397198117257; Tue, 14 Mar 2023 09:53:34 -0700 (PDT) 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-113-1kk3m8YMNImusmNamLma9Q-1; Tue, 14 Mar 2023 12:53:29 -0400 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 2CDB185CC0B; Tue, 14 Mar 2023 16:53:19 +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 0D33540C1434; Tue, 14 Mar 2023 16:53:19 +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 90FEC19472E4; Tue, 14 Mar 2023 16:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E138D19465A3 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D7BB02166B33; Tue, 14 Mar 2023 16:52:36 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DD4D2166B26 for ; Tue, 14 Mar 2023 16:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812813; 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=MSAsvI/ZUduep7EiZCbFtLNx9xa+ycxksJhvH50KY+s=; b=ZTLDd/37XhAhpR1QP8wzFGMhTSUIR805JI2gDv5IHGQb1z5fzs+B4Jhr/Ah/jcSFE1/PGY nwVP1CXG7emaAphgMG50MI3cjltCdrxFKuhpCbDY3R+oRTj5denWej9zFqE8iuOOC4BWgR VznZBDmQFrMjBQFQ+JLUByhVgNO4vlA= X-MC-Unique: 1kk3m8YMNImusmNamLma9Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 09/15] qemu: Fix qemuDomainGetEmulatorPinInfo() Date: Tue, 14 Mar 2023 17:52:23 +0100 Message-Id: <2798aaec3dbc49fb42e2688292d7d7e41b1f2d34.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812816161100001 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 fd8136be37..754b2a8192 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 Tue Apr 16 15:38:24 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=1678812865; cv=none; d=zohomail.com; s=zohoarc; b=g4JtRHkcIXz+z6E9fMzUE9RZXa9xMWdako8+yK114gzSw/ollOAgxFEElR91ujpKd2KD3qa+hpcChP20FUh1p9IGB/XJYQ0kGspCNmcZmx98vxRQIRKD3k3eqPOA73UNLp2u05/3wgIQ002Lw2qkaAtZ5OQqxhlGB2jDjG7Y1VI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812865; 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=irADyf5Pc9gceCZz2M0W3UMS2+ofdlDtVGgEX9Gybbk=; b=MlK0gpboENdpuqcUQcfIkGQUgqjC3Oum3yxNmox4oO6XjrjtQCj4bhHCvNGn3o3gTyB22C2NX3HHO+6mAFd+2jOc/9rk61bWFpzoCxYME26gm0z9rbm4ACcOkNjcOe8TKxl6HxdBUgTu+k6V6SC3Jt1M2ExH+UseitWz9Nt7Qxs= 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 1678812865689396.55032715215555; Tue, 14 Mar 2023 09:54:25 -0700 (PDT) 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-77-yIToI7YHMnmflso05STR-g-1; Tue, 14 Mar 2023 12:53:19 -0400 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 B72EB857F6D; Tue, 14 Mar 2023 16:53:12 +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 A18401410F1B; Tue, 14 Mar 2023 16:53:12 +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 BC3361946A7E; Tue, 14 Mar 2023 16:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E231F19465BA for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 74DF52166B34; Tue, 14 Mar 2023 16:52:37 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1B1FB2166B26 for ; Tue, 14 Mar 2023 16:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812863; 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=irADyf5Pc9gceCZz2M0W3UMS2+ofdlDtVGgEX9Gybbk=; b=TV9fcpfayAmBCRQ3qJxy/v0kOz+cORVH2vWbYpMhytjULM8L+WkqW/xnDuN3va9dkJZZNt M+iIhuGEB0PsAQYt7Hej2L+OQx7fFEo0FcU88omaOfSMSmPcIZE246+WDVSErQRDzdfD6s AZoj1cYV0gUFfhdc/v8pyW1SvwSBOJQ= X-MC-Unique: yIToI7YHMnmflso05STR-g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 10/15] qemuBuildMemoryBackendProps: Join two conditions Date: Tue, 14 Mar 2023 17:52:24 +0100 Message-Id: <30447a8cbea8ab75089b9c3036396cb43dcd82ae.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812866435100001 Content-Type: text/plain; charset="utf-8"; x-default="true" There are two compound conditions in qemuBuildMemoryBackendProps() and each one checks for nodemask for NULL first. Join them into one bigger block. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 929bcc0be1..b0cb252d0b 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3437,19 +3437,21 @@ 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; + } } =20 /* If none of the following is requested... */ --=20 2.39.2 From nobody Tue Apr 16 15:38:24 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=1678812812; cv=none; d=zohomail.com; s=zohoarc; b=SqEIImT2HVpxRHX/uuAtrNENYdEpoPU1f+zbV52FHHdqlPtxF/5f3b58nZgbU4LNArTmK2BBqIGVc4JPOp9woTA/BgO+WJ6vlR1Jo3qnO/Gu54zJubj9VFxwTIKAOO7uRqm/qgtX+bQOSIwHDzniOtwYhWI2wkuUKRT3QKW7CE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812812; 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=yQKfQUmiZLoWdGksyE69hqVLntTupxRx8vutGDfVM0A=; b=i+dypW7h6JVG3qD/LyxHDsSyOtbpwvq6FMOuc6Aa0u5sQwOcqvGeAy6nc9lfq84nk0LDszXmy4MR2plr8rEDKs7kxc+03OJ0QjAzpBd30In1B68UtWz2CaGgsZKvvwBWSSq7ahRNsBkYOrFdF10H6bLQs3Q4QQOXoYFqk/6J+Fo= 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 1678812812472936.6791535482623; Tue, 14 Mar 2023 09:53:32 -0700 (PDT) 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-149-PNWrIrByNvWMv2PuMvQjHQ-1; Tue, 14 Mar 2023 12:53:27 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B5629104456B; Tue, 14 Mar 2023 16:53:19 +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 99FA420316DA; Tue, 14 Mar 2023 16:53:19 +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 A0AD119472F5; Tue, 14 Mar 2023 16:53:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E207419465B2 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 129352166B35; Tue, 14 Mar 2023 16:52:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id ACD402166B26 for ; Tue, 14 Mar 2023 16:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812811; 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=yQKfQUmiZLoWdGksyE69hqVLntTupxRx8vutGDfVM0A=; b=epQyoi6m0zxxUE6GtyBDXITs+6kLaRUGpf8fpvro1D7tLM0Ol3zDikS2E0mqUnHLpiVaGx K8/08/F4kUW0xtVE0OFbWmVwxe2iCtIvFlwFjDB8qo04TID328BryxgzuF+Sz84fezVXk9 InQ5MnnSiD6o67jqGEBdN8Xrtoqzp8c= X-MC-Unique: PNWrIrByNvWMv2PuMvQjHQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 11/15] qemu: Add @nodemaskRet argument to qemuBuildMemoryBackendProps() Date: Tue, 14 Mar 2023 17:52:25 +0100 Message-Id: <7e69de957db7e8d001e7741e6ec8533b202be8e0.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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.4 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: 1678812814079100001 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), if 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 Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_command.c | 14 ++++++++++---- src/qemu/qemu_command.h | 4 +++- src/qemu/qemu_hotplug.c | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b0cb252d0b..15ba3c02d1 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; @@ -3451,6 +3453,9 @@ qemuBuildMemoryBackendProps(virJSONValue **backendPro= ps, "S:policy", qemuNumaPolicyTypeToStri= ng(mode), NULL) < 0) return -1; + + if (nodemaskRet) + *nodemaskRet =3D nodemask; } } =20 @@ -3504,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 @@ -3528,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) @@ -7179,7 +7185,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 Tue Apr 16 15:38:24 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=1678812908; cv=none; d=zohomail.com; s=zohoarc; b=LooBRNnBQHoBnCSXEhb2YaEck5iQOd1P9Y6fn9OhplZAuRoz1HR3iD5xAxcY2xlpw+MLoFeQQYBPsK2PipN69VTw9tQclEvvnNbz9Q8bmao47TQe9w9UcCIsQe+q3/oFs4PsuI8sSO63K/gfM2rBvQ8k+ulOY5xZj0FGKBsne7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812908; 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=U6NKIX3mnJZcRvSvjjj5VTByVBjSWHseoRUQSeuHz8Q=; b=gkcZ2gqbCtzQBrsUfA5zNR1nnUw+2NeAbHzfaqzBcM5LvuNsddMGL2vl4rHW3UfymitcsaLpJXUP2rmp1IwjhPdTYycapY3nfjg3T3fV1GQHGm5BL9/FeMHlCntgi2ClHZ8XvpkjQ/ZJLIK3KAO+729sZLhA/f7rOk3w1jlwWSY= 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 1678812908857255.72582303747458; Tue, 14 Mar 2023 09:55:08 -0700 (PDT) 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-412-P0PBuKpUP5K7pbarRnGRdA-1; Tue, 14 Mar 2023 12:55:02 -0400 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 547AD857F7E; Tue, 14 Mar 2023 16:53:13 +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 3BC161121331; Tue, 14 Mar 2023 16:53:13 +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 06BB119472D0; Tue, 14 Mar 2023 16:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E109919465A2 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id A359C2166B26; Tue, 14 Mar 2023 16:52:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49BC82166B36 for ; Tue, 14 Mar 2023 16:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812907; 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=U6NKIX3mnJZcRvSvjjj5VTByVBjSWHseoRUQSeuHz8Q=; b=Ouc7J46CugyC0K6wrCNDoU1UGXBxNtWNANuGj17IFWX3DKF4f5KvifzIG/HdD40IvGd5LX 92nuuLex8gAqRlcS3yQoLkFJBjUg52d9CMhOinOeEQzRaey2KpYlSj5WJRuY63b5zrdRrF fw5ligGrk27pYUQd8z9Tq9iP/FJ1b6Y= X-MC-Unique: P0PBuKpUP5K7pbarRnGRdA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 12/15] qemu: Add @nodemask argument to qemuBuildThreadContextProps() Date: Tue, 14 Mar 2023 17:52:26 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812910780100009 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 15ba3c02d1..6de3b549a0 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 @@ -7178,17 +7177,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 && @@ -7459,6 +7459,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; @@ -7480,10 +7481,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) @@ -7513,7 +7516,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 Tue Apr 16 15:38:24 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=1678812816; cv=none; d=zohomail.com; s=zohoarc; b=dVAw3yfDfi6q/OtRbJFCaPvcl/I5kHX5H94VuTb8OMc82EcWOQP3XuUkWRuhmxnJadURQJnPq4lOf4IOeF6SyfrEmz6tVAP74/R/ESgQ+Zts62/GTneSWf4IREkQ+D7d/T/75eL4CT/+/trq0pvWFKSugfUUuBVheadIZtOZ/ok= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812816; 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=crY723lTIgkkx/bPq/UYkIpTpPIdk0z0XWN5o+yNM8A=; b=Pxh+IO74SXP7JsBYxcyeAuCl/FcOTOL0pMRloVony32MAxj4WmXLUikwSm+F0uds2WznEHnVcX8oy990FsVp6fsnG5xtLD19jzLaQsCZ6BflXXhEGyUvgVjjNbjEy8HNWJ+wNZAcSAgrODGnj0ICDR9Au5LfcnuVJHspLdDk7BI= 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 1678812816181916.7239736237186; Tue, 14 Mar 2023 09:53:36 -0700 (PDT) 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-18-_6nQo6iVMpuzB5RItwPgXQ-1; Tue, 14 Mar 2023 12:53:32 -0400 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 8EA4138601BD; Tue, 14 Mar 2023 16:53:19 +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 7550440C6E68; Tue, 14 Mar 2023 16:53:19 +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 640C319472F0; Tue, 14 Mar 2023 16:53:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E161319465A4 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 405E32166B37; Tue, 14 Mar 2023 16:52:39 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAE8E2166B36 for ; Tue, 14 Mar 2023 16:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812815; 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=crY723lTIgkkx/bPq/UYkIpTpPIdk0z0XWN5o+yNM8A=; b=cjHu1LmX7jtDawJfandeF+ODGm9P4l1NMXUUQQCM+enjDcVydFvelpMdEaKOcb2OvgF3Vm SZibc8JJNaqYtttchwbiwQ2oB0p017c8sTORooRcceU+0nDThpOa7XTyxUN70rd0U8zCxg ftAgTLMbmDEweBYQJqcvT3rVY3b4Q38= X-MC-Unique: _6nQo6iVMpuzB5RItwPgXQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 13/15] qemuBuildThreadContextProps: Prune .node-affinity wrt Date: Tue, 14 Mar 2023 17:52:27 +0100 Message-Id: <8c51950068b340e337984e76c0dad29dfd2e83bb.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812818189100005 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 Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- 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 6de3b549a0..7137edac8f 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(emulatorpin, &emulatorNodes) < 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", @@ -7188,7 +7208,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 && @@ -7517,7 +7537,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 Tue Apr 16 15:38:24 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=1678812804; cv=none; d=zohomail.com; s=zohoarc; b=E5e6hkt63Fy4FlL2ZLT/s1yu7929DEugf+FmXr3SFyTb0dRoDhJcxIKzvvIfbyHn3dagapdPyXRolElkWK7mVH2+sADsJYXdqac1u/UvZ53fyfbif0Is1gUvb4EUhbA5XfOAQj/sLe3Hm2gt/dOTf2JPpDRpP/vUY6LA3JtdCUI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812804; 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=eewBzjr/ackRY64SCy4wX5NLIFWVUUORWQC169y6QVE=; b=QTzKC0/Y1k9OHvt9bGUfUs4P+DIKZMwnU4LSngFlR+mjiKZnrR8oEUbQjd0iDQj1lApvD+Ni/kwNT4W3XgpJ9jN+ieuyZfhhPq1WAK32QkFMySTMcxkl2qbR6KfLCSMOS6/0TSP2ndgnIaqmJAKGUiSVvBRcRq2lUv23eaZNd1U= 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 1678812804118876.483356089334; Tue, 14 Mar 2023 09:53:24 -0700 (PDT) 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-378-JOfVtlucPpefd2J59BaN8g-1; Tue, 14 Mar 2023 12:53:16 -0400 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 C54AA83B9F1; Tue, 14 Mar 2023 16:53:12 +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 A2F421731B; Tue, 14 Mar 2023 16:53:12 +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 C01091946A7F; Tue, 14 Mar 2023 16:53:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E1E1E19465A8 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D159F2166B38; Tue, 14 Mar 2023 16:52:39 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77D2A2166B36 for ; Tue, 14 Mar 2023 16:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812803; 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=eewBzjr/ackRY64SCy4wX5NLIFWVUUORWQC169y6QVE=; b=GoftVHYhD8ppeZzOSHcbORjgFN6Ad85hc6ULX213CohvXwhrIStqe2FGr9FzK2YGM5oh8q aYz80xQ8G5Ho8iB6jB7S6a6OyikY/w+rIiQDS2ISMV0Nh9QJfxtweVk7+LCQSauNovlTw6 44txHMAIwMHnVpo8kCHwwn0wdh+D0Uc= X-MC-Unique: JOfVtlucPpefd2J59BaN8g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 14/15] docs: Document memory allocation and emulator pinning limitation Date: Tue, 14 Mar 2023 17:52:28 +0100 Message-Id: <37ee6dacd77ce7b571bc4e222a8ed0595147df8a.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812805935100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- docs/formatdomain.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 4f4874eba2..27f83e254d 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 Tue Apr 16 15:38:24 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=1678812816; cv=none; d=zohomail.com; s=zohoarc; b=XWDd9trvbY3WyZwp4+9YatuNpQ2uuwr8NNSGAS41WqRqyjIi0wC/b16MprzEI5WQ1Qgzrratlkpfdf0qS67dnCYByh/nd7Px0M7UDSPgJ/U8CNy3AZrudqSEzh8WxxWlA2ZakvaO2nR4bG/RwUz5CowyqI7orS4Yt1pR0PN17BU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678812816; 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=ntFJaDgIKUBHxGTXsk0QsNZyl5OLom9szH4sKTzzhvw=; b=WSCHW96vgEudotU1R/z0f8f5Z8d/8bYQG7WhMRoYRiF4ZMy0kY+DwBI41RFZiCpWuBX2qzNRu0YN3BZN998OoNG8Ir7cUgvjiZhsa8dk8N7p5GpW2NoNo76AJiPX3niDZVhOHbRj63+7PD7HSC7m+nU0E9Vg4TDqMfRF0ECWlPE= 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 1678812816688556.3862389055342; Tue, 14 Mar 2023 09:53:36 -0700 (PDT) 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-66-W5IuDtvDM9mMvzA4SdWfWA-1; Tue, 14 Mar 2023 12:53:32 -0400 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 DAD193C14868; Tue, 14 Mar 2023 16:53:18 +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 C1CD8112132D; Tue, 14 Mar 2023 16:53:18 +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 4C70819472D9; Tue, 14 Mar 2023 16:53:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id CAF2A19465A0 for ; Tue, 14 Mar 2023 16:52:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6F31E2166B2C; Tue, 14 Mar 2023 16:52:40 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 14AAB2166B36 for ; Tue, 14 Mar 2023 16:52:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678812815; 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=ntFJaDgIKUBHxGTXsk0QsNZyl5OLom9szH4sKTzzhvw=; b=hiZ/SlIFVzKVelNQFo6KqskCEW5beY5YpgzLbBAFm3ZlYCfzgIqGpg17PlZ9IkPK7UMHoZ gaxUth3BU+lXsyyS7U1z8DzKWqnJnKtZvvoywJ5VHeBxPs6oymzKBExHYTa6j6/5QUeJFA 6+UAptUx5zuIocSTnehHcRqiFqoo8Qw= X-MC-Unique: W5IuDtvDM9mMvzA4SdWfWA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 15/15] NEWS: Document recent thread-context bug fix Date: Tue, 14 Mar 2023 17:52:29 +0100 Message-Id: <8e558eaf8d5a23e014808821a7324985c349d974.1678812657.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: 1678812818120100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani Reviewed-by: J=C3=A1n Tomko Reviewed-by: Kristina Hanicova --- NEWS.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index e5b304786b..5b5265996f 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -48,6 +48,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