From nobody Thu May 2 18:37:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591814183; cv=none; d=zohomail.com; s=zohoarc; b=nMRfq2MP2wsA9B7GwOOwBat8GQBDwOzL3fV5cKHvagCbglwRwU9cwbGo7y0UNGzuE5jg0r/vXiZeVOiUuanaR940ddTA3pRIkhxqXogH8VTkGO2nDJuqmfrsZJJA4Bss0rIKVkuS/3hD4wPWknRzgd1Q+hpdzJgXjn5Pg39BD48= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591814183; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PPqEhwKTm2fu8INzxOrvtwfOKOLOE0/P+OnOOv+IHcE=; b=F/tz1wtu7YmkCONyUOOGFv4OlyivxZda4QjVX1NPVSqQUVr1lHJ1zl6cTlQajqFeZ5B2L1mKZ0eaUvl2nIyzK3BfXSHBkwpmbv9oVFgRPEI8ZM4g6e7/nViewzFgXViYXCVUZ8e7YHTtdNzJDbH/fnYN7i9DxL9rvxmCKpcabq0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 15918141833441019.5002486266465; Wed, 10 Jun 2020 11:36:23 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-lGZrsFGgNU2G_cvKjjXhQA-1; Wed, 10 Jun 2020 14:36:16 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 01687801503; Wed, 10 Jun 2020 18:36:11 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A267F100238D; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id C7BA51809547; Wed, 10 Jun 2020 18:36:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05AIa88a024063 for ; Wed, 10 Jun 2020 14:36:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 9E1B910F26F6; Wed, 10 Jun 2020 18:36:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99ABE10F26F4 for ; Wed, 10 Jun 2020 18:36:06 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A56111859160 for ; Wed, 10 Jun 2020 18:36:06 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-401-mC3N-B8zNCiUoDFzVNjnqg-1; Wed, 10 Jun 2020 14:36:04 -0400 Received: by mail-qt1-f194.google.com with SMTP id z1so2610114qtn.2 for ; Wed, 10 Jun 2020 11:36:03 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b081:e954:9388:2ec6:d6f4]) by smtp.gmail.com with ESMTPSA id k20sm599033qtu.16.2020.06.10.11.36.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 11:36:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591814182; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PPqEhwKTm2fu8INzxOrvtwfOKOLOE0/P+OnOOv+IHcE=; b=KbtXBPglSk3YHH8vrh8cyK5Tld1V1KBpbeX9HgHAVb+YvUVLLoYH4URb9Y9FR8PiwiRLvy HzAivkXi/4FyJkzkk0WvJ8qI3MTyVB5gC8vAYU9l56cKbtekk0r+EmUpEzG6zd90Xa0Ss4 +6RoZGdOWc13bkmgVIelJreXaCc1OtI= X-MC-Unique: lGZrsFGgNU2G_cvKjjXhQA-1 X-MC-Unique: mC3N-B8zNCiUoDFzVNjnqg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PPqEhwKTm2fu8INzxOrvtwfOKOLOE0/P+OnOOv+IHcE=; b=SVlGGiAbubXsqEpwPraUlc1Lgp8dLydkvYvRfAIrmNOvSWAe1XQC+SVEIek1NRx+mL /1qtW/AVBXeGV99IgYJ3pq1gpzcqL/7UPFC66/JI2HE52VYxaE4PR2SPtsnTJjBaUaPZ far+AIWQGl5uSOrbny8CE7UuIWQDYkbcukD2SQp6STmYkkemNJbL8+3UmmzsMq06S1LT HX8VVJXIOd585he0DUHXowGdRwu8AoapDFs4b/m86CRQWyP4IEoev0CjPMNx00Ohkxkx WV6N3gW9eMBQd1j/4+YOV3TRTE9oF7QgMuUjnZENejS2O2RJVQ3UgVsOlwtvJQFXWK+c hnSA== X-Gm-Message-State: AOAM530ggpTa00QHWmz3Zp/ckzQTlAXWCcU/HWwr5di5kIj83CXseOdJ +u3PVZ65d4WJsdM98ie6yfRAFSjo X-Google-Smtp-Source: ABdhPJyL0efuaxqsAOD1ijVCfA4uDYH3bq0yNUvcuouJcD8OO8tmJfAfzJc2iCMrA9S7wfbAEzW5FA== X-Received: by 2002:aed:2d23:: with SMTP id h32mr4721011qtd.69.1591814163282; Wed, 10 Jun 2020 11:36:03 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 1/4] numa_conf.c: add helper functions for cpumap operations Date: Wed, 10 Jun 2020 15:35:50 -0300 Message-Id: <20200610183553.466611-2-danielhb413@gmail.com> In-Reply-To: <20200610183553.466611-1-danielhb413@gmail.com> References: <20200610183553.466611-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" These helpers will be used in an auto-fill feature for incomplete NUMA topologies in the next patch. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/conf/numa_conf.c | 46 ++++++++++++++++++++++++++++++++++++++++ src/conf/numa_conf.h | 3 +++ src/libvirt_private.syms | 1 + 3 files changed, 50 insertions(+) diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 09811cb51b..d022685284 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -1372,3 +1372,49 @@ virDomainNumaGetMemorySize(virDomainNumaPtr numa) =20 return ret; } + + +static int +virDomainNumaRemoveCPUsFromMap(virBitmapPtr result, virBitmapPtr exclude) +{ + size_t i; + + for (i =3D 0; i < virBitmapSize(exclude); i++) { + if (!virBitmapIsBitSet(exclude, i)) + continue; + + if (virBitmapClearBitExpand(result, i) < 0) + return -1; + } + + return 0; +} + + +int +virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, size_t node, + unsigned int maxCpus) +{ + g_autoptr(virBitmap) maxCPUsBitmap =3D virBitmapNew(maxCpus); + size_t i; + + if (node >=3D virDomainNumaGetNodeCount(numa)) + return -1; + + virBitmapSetAll(maxCPUsBitmap); + + for (i =3D 0; i < numa->nmem_nodes; i++) { + virBitmapPtr nodeCpus =3D virDomainNumaGetNodeCpumask(numa, i); + + if (i =3D=3D node) + continue; + + if (virDomainNumaRemoveCPUsFromMap(maxCPUsBitmap, nodeCpus) < 0) + return -1; + } + + virBitmapFree(numa->mem_nodes[node].cpumask); + numa->mem_nodes[node].cpumask =3D g_steal_pointer(&maxCPUsBitmap); + + return 0; +} diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index ae3599bb8b..cdf87a87e8 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -185,3 +185,6 @@ int virDomainNumaDefCPUParseXML(virDomainNumaPtr def, x= mlXPathContextPtr ctxt); int virDomainNumaDefCPUFormatXML(virBufferPtr buf, virDomainNumaPtr def); =20 unsigned int virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa); + +int virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, size_t node, + unsigned int maxCpus); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a6af44fe1c..788e08045a 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -834,6 +834,7 @@ virDomainMemoryAccessTypeFromString; virDomainMemoryAccessTypeToString; virDomainNumaCheckABIStability; virDomainNumaEquals; +virDomainNumaFillCPUsInNode; virDomainNumaFree; virDomainNumaGetCPUCountTotal; virDomainNumaGetMaxCPUID; --=20 2.26.2 From nobody Thu May 2 18:37:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591814181; cv=none; d=zohomail.com; s=zohoarc; b=exKLSkl5fx1yuEiO0XS+SvCTG9YkTbYWQ+VCtuKCrIoZokjJDAqqYiZEC4z8F2E3oD7nAeQPBteNCXtfAYnjp7NsB4Ugn3RgxwBuIxTomnwkeHQA1/4bUf4VzfEIe0JzkETi0tO1dGZEocjuwowH5V9fTFYWKMEljGKL7sPIoME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591814181; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SbiLjL6CsnqQcReDLaku5atsQ5bXZxPwLCpq3TMdOFs=; b=hxwtrfbXg09ICSOz5U2xHrV3QvgqSA/iw557QJTKLNw7KQO4ML6SSGTQWoy5SXKZXmW9SuHFR8GWVIBabqrTP7aSUv5RbZEhNXZQ+5AK1mfVZpTcwxSGOrTE8Y0K1najWYacqlUB2iw/aYHjG7LLwJqW5Az6x8g6I+eVsnXpMT8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1591814181336990.2140587274932; Wed, 10 Jun 2020 11:36:21 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-327-_rr5ZpxHNZ20d4PmuGGS0Q-1; Wed, 10 Jun 2020 14:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B24251083E89; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 937D05D9D7; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 5E513B34AA; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05AIaADB024074 for ; Wed, 10 Jun 2020 14:36:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51F7410F26F6; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D9C310F26F4 for ; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34CE6811768 for ; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-ECtUHVgDP129U2cxUbY0cQ-1; Wed, 10 Jun 2020 14:36:05 -0400 Received: by mail-qv1-f42.google.com with SMTP id y9so1506083qvs.4 for ; Wed, 10 Jun 2020 11:36:05 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b081:e954:9388:2ec6:d6f4]) by smtp.gmail.com with ESMTPSA id k20sm599033qtu.16.2020.06.10.11.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 11:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591814180; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SbiLjL6CsnqQcReDLaku5atsQ5bXZxPwLCpq3TMdOFs=; b=VfZevJVfURwaBfHroWrJfW90aZb4+haZvhXKJmQu8nleqMVUMVL+NuJl+SDVjISl9CD3hp ntJZHKU8XjcGXXpD33cjr/ZiPgrMYnA0jPwD8TdpF5L0nf4FrHOgD2WtLu5/etkTEctFp3 Zar+pbxYYrI/CWukaiyHVmN/lSdmHuw= X-MC-Unique: _rr5ZpxHNZ20d4PmuGGS0Q-1 X-MC-Unique: ECtUHVgDP129U2cxUbY0cQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SbiLjL6CsnqQcReDLaku5atsQ5bXZxPwLCpq3TMdOFs=; b=snZS0wRHJHszFgUExb7c995fZo4hXHlcctagAbC3NzSYi2/dAs/nrO9q0a9j4jHiEk 5iMroosm/dnzx2tNt8Qt+jWhijUm+oeMJclL8TWTVv4GNCSnPKQ0dLPf6Q1mBMd49P+t mjo++tvS/yPuoNxMjsZinoJ4ZWOBh0fLLL+MyWW5e23IQJFoWaYZ7oULQCiVQJNd2AKE FyiOFKwwJGHesqZ51Y7abmogMkYRECHNSf+B3AuZ0Fr+yK6YYnSivexeS39f3ocqJVcG Bm0hjQPe3z5P8x6j1NIuioplW867gv9gV1N46TZJxQySsONBnFEj6kCJRHv2h1hMeJvM Zm/w== X-Gm-Message-State: AOAM530ocUvyyzqwSAaZ+9sO4N5Zew7UeqoBw0NW7O9LmneKiu6e2bIf 5QpSHMjk73vbnIk1wGMkwg0sJAnz X-Google-Smtp-Source: ABdhPJw68IUr/nKGbz7waIy0MFLmIOKNrcD63jxEMbxbmsx46+q27yevtLWJMPb4+qGAggUQnKkACA== X-Received: by 2002:ad4:4cce:: with SMTP id i14mr4376218qvz.207.1591814164943; Wed, 10 Jun 2020 11:36:04 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 2/4] qemu_domain.c: NUMA CPUs auto-fill for incomplete topologies Date: Wed, 10 Jun 2020 15:35:51 -0300 Message-Id: <20200610183553.466611-3-danielhb413@gmail.com> In-Reply-To: <20200610183553.466611-1-danielhb413@gmail.com> References: <20200610183553.466611-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Libvirt allows the user to define an incomplete NUMA topology, where the sum of all CPUs in each cell is less than the total of VCPUs. What ends up happening is that QEMU allocates the non-enumerated CPUs in the first NUMA node. This behavior is being flagged as 'to be deprecated' at least since QEMU commit ec78f8114bc4 ("numa: use possible_cpus for not mapped CPUs check"). In [1], Maxiwell suggested that we forbid the user to define such topologies. In his review [2], Peter Krempa pointed out that we can't break existing guests, and suggested that Libvirt should emulate the QEMU behavior of putting the remaining vCPUs in the first NUMA node in these cases. This patch implements Peter Krempa's suggestion. Since we're going to most likely end up with disjointed NUMA configuration in node 0 after the auto-fill, we're making auto-fill dependent on QEMU_CAPS_NUMA. A following patch will update the documentation not just to inform about the auto-fill mechanic with incomplete NUMA topologies, but also to discourage the user to create such topologies in the future. This approach also makes Libvirt independent of whether QEMU changes its current behavior since we're either auto-filling the CPUs in node 0 or the user (hopefully) is aware that incomplete topologies, although supported in Libvirt, are to be avoided. [1] https://www.redhat.com/archives/libvir-list/2019-June/msg00224.html [2] https://www.redhat.com/archives/libvir-list/2019-June/msg00263.html Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_domain.c | 47 ++++++++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 4 ++++ src/qemu/qemu_driver.c | 9 ++++++++ 3 files changed, 60 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2dad823a86..76191e028b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4963,6 +4963,50 @@ qemuDomainDefTsegPostParse(virDomainDefPtr def, } =20 =20 +/** + * qemuDomainDefNumaCPUsRectify: + * @numa: pointer to numa definition + * @maxCpus: number of CPUs this numa is supposed to have + * + * This function emulates the (to be deprecated) behavior of filling + * up in node0 with the remaining CPUs, in case of an incomplete NUMA + * setup, up to getVcpusMax. + * + * Returns: 0 on success, -1 on error + */ +int +qemuDomainDefNumaCPUsRectify(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) +{ + unsigned int vcpusMax, numacpus; + + /* QEMU_CAPS_NUMA tells us if QEMU is able to handle disjointed + * NUMA CPU ranges. The filling process will create a disjointed + * setup in node0 most of the time. Do not proceed if QEMU + * can't handle it.*/ + if (virDomainNumaGetNodeCount(def->numa) =3D=3D 0 || + !virQEMUCapsGet(qemuCaps, QEMU_CAPS_NUMA)) + return 0; + + vcpusMax =3D virDomainDefGetVcpusMax(def); + numacpus =3D virDomainNumaGetCPUCountTotal(def->numa); + + if (numacpus < vcpusMax) { + if (virDomainNumaFillCPUsInNode(def->numa, 0, vcpusMax) < 0) + return -1; + } + + return 0; +} + + +static int +qemuDomainDefNumaCPUsPostParse(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps) +{ + return qemuDomainDefNumaCPUsRectify(def, qemuCaps); +} + + static int qemuDomainDefPostParseBasic(virDomainDefPtr def, void *opaque G_GNUC_UNUSED) @@ -5049,6 +5093,9 @@ qemuDomainDefPostParse(virDomainDefPtr def, if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0) return -1; =20 + if (qemuDomainDefNumaCPUsPostParse(def, qemuCaps) < 0) + return -1; + return 0; } =20 diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 41d3f1561d..e78a2b935d 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -1297,3 +1297,7 @@ qemuDomainInitializePflashStorageSource(virDomainObjP= tr vm); bool qemuDomainDiskBlockJobIsSupported(virDomainObjPtr vm, virDomainDiskDefPtr disk); + +int +qemuDomainDefNumaCPUsRectify(virDomainDefPtr def, + virQEMUCapsPtr qemuCaps); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 88517ba6a7..ff9414f3c4 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -4999,6 +4999,7 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver, unsigned int nvcpus) { g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + g_autoptr(virQEMUCaps) qemuCaps =3D NULL; unsigned int topologycpus; =20 if (def) { @@ -5029,6 +5030,14 @@ qemuDomainSetVcpusMax(virQEMUDriverPtr driver, if (virDomainDefSetVcpusMax(persistentDef, nvcpus, driver->xmlopt) < 0) return -1; =20 + /* re-adjust NUMA nodes if needed */ + if (!(qemuCaps =3D virQEMUCapsCacheLookup(driver->qemuCapsCache, + persistentDef->emulator))) + return -1; + + if (qemuDomainDefNumaCPUsRectify(persistentDef, qemuCaps) < 0) + return -1; + if (virDomainDefSave(persistentDef, driver->xmlopt, cfg->configDir) < = 0) return -1; =20 --=20 2.26.2 From nobody Thu May 2 18:37:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591814188; cv=none; d=zohomail.com; s=zohoarc; b=IS/9FrKrFCD3W46gy3xULoFU6/s1uUrPZAYtYTWQNmITgrpkr7aawYm2GV9LexEG8r0WDhbR1KPBhE2w2U73eiakKYJ22ciAEubq49BjUb2rSdjMkEbv3/+o5ophtCy9ny9su/TzQpbbhiiDd5AACnH6GcUwgc635YL4KJbWLD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591814188; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Vkta7brfpwKucT3rF4/7tn2bY89P1XlZEv5N7iOEJZ0=; b=VCywMpcrz3AwnqZ4F2frnz3u6FVRYZZ+Y3OcMxXtMqRLcmqtQI3/Zvaj+yRo70qZJ1z2Gwq6ASuS3VMfsCwzriPmr0VEfpFFh8YNkGu/vL4bHcZUnGMX4sKQUXISGHd3kuJXDBVKYHkFmS+02jVSUFkXtuFtCPTSmA7CCpdlCXA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1591814188905487.306894450237; Wed, 10 Jun 2020 11:36:28 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-410-iVi50FTENXeYYRLkeegBoQ-1; Wed, 10 Jun 2020 14:36:24 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CDC101083E8A; Wed, 10 Jun 2020 18:36:17 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AE5225D9D7; Wed, 10 Jun 2020 18:36:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7D410B34B3; Wed, 10 Jun 2020 18:36:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05AIaDmO024107 for ; Wed, 10 Jun 2020 14:36:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id E33DB2026D5D; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A34792026FFE for ; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5378F8007A4 for ; Wed, 10 Jun 2020 18:36:10 +0000 (UTC) Received: from mail-qt1-f196.google.com (mail-qt1-f196.google.com [209.85.160.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-422-RxpTUWHaNm26t4VjRy_NHQ-1; Wed, 10 Jun 2020 14:36:08 -0400 Received: by mail-qt1-f196.google.com with SMTP id k22so2586846qtm.6 for ; Wed, 10 Jun 2020 11:36:08 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b081:e954:9388:2ec6:d6f4]) by smtp.gmail.com with ESMTPSA id k20sm599033qtu.16.2020.06.10.11.36.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 11:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591814187; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Vkta7brfpwKucT3rF4/7tn2bY89P1XlZEv5N7iOEJZ0=; b=LpDSDhGJ/vhpv6ww281hQ5SrapeY+8+C4qpVm3h8UvjrNc++P2QPwsdVNeOlTKq6d2va/s ajz6zN99sZsedTL5PuSNQVL8KVE0vMIZGtavmoR9MDzQpaXlBfnu6tuN4KkGmYRfbkDOOz jJAYgc5a+sAk5qPMpg6pjefm6lXmYVE= X-MC-Unique: iVi50FTENXeYYRLkeegBoQ-1 X-MC-Unique: RxpTUWHaNm26t4VjRy_NHQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vkta7brfpwKucT3rF4/7tn2bY89P1XlZEv5N7iOEJZ0=; b=mrjNRCWRzmAu1zJSOlGcLGTWCc0LhHscrUxdGQoaaKfWtbAQvB2YrxmYqHFGMEM08t e6PKUhLo8p/rHcgDPhoa0kz+Zg/ZzyEpeHP4jz6saHCX23pXSwrlAI8e6ucvrfSCQbeR LlpaCt7M2+slIS2nwPmlaURujbA6o3XQHJXgXAM7UFBoL1kUE0Oe6+Hn78SoJgelu8W/ P7cWohiStkl8xgnXtd4prm0zKmdMy5eCjFtSgDBxuHTad4al4drZqB6t4QTh16cR8dzu JVvnwRCjNEJZpARYUt8ktIljSrk2k9qIYj+rBEwqE8VsSGc8qWwcT2sCJXrwrp1TQii2 fYHg== X-Gm-Message-State: AOAM533JJmc/SlJ7mmEaw3H+uMJ9yFsoI868PctlwFukEzk74vf2zJlu XnT8df9JJWalsp84jfpb3eICj4Mk X-Google-Smtp-Source: ABdhPJwHqZA4T/zfRek/hOdcnyw7iMkQPWLNUEnIJYy62WNP+Htc98DpHA4OTWpKFdNzhscQXvcupw== X-Received: by 2002:ac8:6f55:: with SMTP id n21mr4657566qtv.175.1591814166823; Wed, 10 Jun 2020 11:36:06 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 3/4] qemuxml2xmltest.c: add NUMA vcpus auto fill tests Date: Wed, 10 Jun 2020 15:35:52 -0300 Message-Id: <20200610183553.466611-4-danielhb413@gmail.com> In-Reply-To: <20200610183553.466611-1-danielhb413@gmail.com> References: <20200610183553.466611-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Add a unit test to verify the NUMA vcpus autocomplete implemented in the previous patch. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- .../numavcpus-topology-mismatch.xml | 37 ++++++++++++++++++ ...avcpus-topology-mismatch.x86_64-latest.xml | 38 +++++++++++++++++++ tests/qemuxml2xmltest.c | 1 + 3 files changed, 76 insertions(+) create mode 100644 tests/qemuxml2argvdata/numavcpus-topology-mismatch.xml create mode 100644 tests/qemuxml2xmloutdata/numavcpus-topology-mismatch.x8= 6_64-latest.xml diff --git a/tests/qemuxml2argvdata/numavcpus-topology-mismatch.xml b/tests= /qemuxml2argvdata/numavcpus-topology-mismatch.xml new file mode 100644 index 0000000000..d3b2c1297e --- /dev/null +++ b/tests/qemuxml2argvdata/numavcpus-topology-mismatch.xml @@ -0,0 +1,37 @@ + + dummy + 4d92ec27-9ebf-400b-ae91-20c71c647c19 + 16777216 + 7864320 + 3906240 + 12 + + + + + hvm + + + + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmloutdata/numavcpus-topology-mismatch.x86_64-la= test.xml b/tests/qemuxml2xmloutdata/numavcpus-topology-mismatch.x86_64-late= st.xml new file mode 100644 index 0000000000..2d2245b10c --- /dev/null +++ b/tests/qemuxml2xmloutdata/numavcpus-topology-mismatch.x86_64-latest.xml @@ -0,0 +1,38 @@ + + dummy + 4d92ec27-9ebf-400b-ae91-20c71c647c19 + 16777216 + 7864320 + 3906240 + 12 + + + + + hvm + + + + qemu64 + + + + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + +
+ + + + + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 157e686f2a..0526a1f104 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -553,6 +553,7 @@ mymain(void) DO_TEST("vcpu-placement-static", QEMU_CAPS_KVM, QEMU_CAPS_OBJECT_IOTHREAD); + DO_TEST_CAPS_LATEST("numavcpus-topology-mismatch"); =20 DO_TEST("smp", NONE); DO_TEST("iothreads", NONE); --=20 2.26.2 From nobody Thu May 2 18:37:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591814190; cv=none; d=zohomail.com; s=zohoarc; b=BarPTE503QdoSWvTjOEMjGIFGaxfFAd8wS/uoDHX6m6dXT5jxlFeooPGFlzAJUrZ89K8Kvb4RIUs754jXcZD0BDC2vrakTly6HccXA1P63XuxTcfLhsVU6rxSPewgNRDw6c0RxpTt76J4wdSFsXHp9ojV4+BLYXXkitV9E5ThXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591814190; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xtJiwqy1yTiKKpNyZPjT+0on1kOrUGWcX4Wsmmv6sek=; b=edMQZPm8OiQQ7+CB75AAmHfvSSwvCKfaplnHAVBUB6Dlrjz8MqV5mSaTlEgY4kAShZsl/c+7U/4wRd9TSrWqDbdusBdd+3DJuoE/1wiONdvuW00EdSXKT1AwlHBYwqBnpRoFKcq5IXYHN5nyilLv8iQII6JRARmxeC0tGjcMbck= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1591814190758600.0495713609513; Wed, 10 Jun 2020 11:36:30 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283-nma2GyAdMg2wymbyIHlOjw-1; Wed, 10 Jun 2020 14:36:27 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 28D341083E80; Wed, 10 Jun 2020 18:36:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 053008FF69; Wed, 10 Jun 2020 18:36:21 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id CB277B34B4; Wed, 10 Jun 2020 18:36:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 05AIaCgA024102 for ; Wed, 10 Jun 2020 14:36:12 -0400 Received: by smtp.corp.redhat.com (Postfix) id A846F2026971; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A2B892026E1C for ; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25CA11049840 for ; Wed, 10 Jun 2020 18:36:12 +0000 (UTC) Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-dtw2vWRSOKyjzrEAEyuLpw-1; Wed, 10 Jun 2020 14:36:09 -0400 Received: by mail-qv1-f65.google.com with SMTP id ec10so1506037qvb.5 for ; Wed, 10 Jun 2020 11:36:09 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b081:e954:9388:2ec6:d6f4]) by smtp.gmail.com with ESMTPSA id k20sm599033qtu.16.2020.06.10.11.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 11:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591814189; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=xtJiwqy1yTiKKpNyZPjT+0on1kOrUGWcX4Wsmmv6sek=; b=CnVI3ahMUX3QxOidJ+50W8g3BP5IlBMksRfT9FQbnCaOK1sqJOaaefN4XADiKVfk4J9Xeq OqGcuMzye8wsQXP8LB2Zcv/88oGZ48uIpRUr8es4W30Y0UDweUTt6rFqGmpssZ8rGjH4iw HSPNyB97Vh1+b+tvyfoQNQk9dJqxWWA= X-MC-Unique: nma2GyAdMg2wymbyIHlOjw-1 X-MC-Unique: dtw2vWRSOKyjzrEAEyuLpw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xtJiwqy1yTiKKpNyZPjT+0on1kOrUGWcX4Wsmmv6sek=; b=F/VRqWgpdOGSxYrFug5JyMdRuNs1NrQo9aDd60q8MKTWca8T38tVlR36AP3S/KUr5S htrk1S4GhSCLlpSGenAJpgFZJcDZ03odE/zh+DMmzWAzVEADlLpYVYBZYKuyNI/R7oo/ fjN01mTnexSmyBkRXtFnrn+8h7T6rBECfehS2F11YAnF3bq4jwiuHgniq2rVKPD8s9vv 4u9CrGkaMAJqhkp45Pi7KDQMrep/Z792Y2iLHTAdPoWB+RoOZ/uOrxd30toEGN5riH44 xakA+itr+3sZfpAJYnf6vS4dpgEAEkK2PIoDt+TFHhD7oh3BVYD4xW1k6EUa2+/4GgaC AwSQ== X-Gm-Message-State: AOAM53355dFVwovJVy+CfHKU+OYEnXWEQkW6X3PxPq9VSqaY2Vo6tkXM xpjrAl7ZM/KNZyztqgyWGu2iXNtl X-Google-Smtp-Source: ABdhPJxxYrAXfTzsOvw4DJCDCirhLjbqDzlnImOQ0kHiE3v2te5UI5oWKNdMrnfcPpIQpC/OO4etPw== X-Received: by 2002:ad4:4f50:: with SMTP id eu16mr3090345qvb.223.1591814168898; Wed, 10 Jun 2020 11:36:08 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 4/4] formatdomain.html.in: document the NUMA cpus auto fill feature Date: Wed, 10 Jun 2020 15:35:53 -0300 Message-Id: <20200610183553.466611-5-danielhb413@gmail.com> In-Reply-To: <20200610183553.466611-1-danielhb413@gmail.com> References: <20200610183553.466611-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We're not mentioning that we're replicating QEMU behavior on purpose. First because QEMU will one day, maybe, change the behavior and start to refuse incomplete NUMA setups, and then our documentation is now deprecated. Second, auto filling the CPUs in the first cell will work regardless of QEMU changes in the future. The idea is to encourage the user to provide a complete NUMA CPU topology, not relying on the CPU auto fill mechanic. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- docs/formatdomain.html.in | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 20c28a47e3..07d0fa5c70 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -1829,7 +1829,16 @@

Each cell element specifies a NUMA cell or a NUMA node. cpus specifies the CPU or range of CPUs that are - part of the node. memory specifies the node memory + part of the node. Since 6.5.0 For the q= emu + driver, if the emulator binary supports disjointed cpus= ranges + in each cell, the sum of all CPUs declared in each cell + will be matched with the maximum number of virtual CPUs declared in = the + vcpu element. This is done by filling any remaining CPUs + into the first NUMA cell. Users are encouraged to suppl= y a + complete NUMA topology, where the sum of the NUMA CPUs matches the m= aximum + virtual CPUs number declared in vcpus, to make the doma= in + consistent across qemu and libvirt versions. + memory specifies the node memory in kibibytes (i.e. blocks of 1024 bytes). Since 1.2.11 one can use an additional = unit attribu= te to --=20 2.26.2