From nobody Fri May 3 15:08:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1535370981523323.39283407381015; Mon, 27 Aug 2018 04:56:21 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 3FDA030842A8; Mon, 27 Aug 2018 11:56:19 +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 8247D101E597; Mon, 27 Aug 2018 11:56:18 +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 93926181A12D; Mon, 27 Aug 2018 11:56:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w7RBuEU5028844 for ; Mon, 27 Aug 2018 07:56:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id C2A7163AF8; Mon, 27 Aug 2018 11:56:14 +0000 (UTC) Received: from dell-r430-03.lab.eng.brq.redhat.com (dell-r430-03.lab.eng.brq.redhat.com [10.37.153.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 151E263A50; Mon, 27 Aug 2018 11:56:10 +0000 (UTC) From: Igor Mammedov To: qemu-devel@nongnu.org Date: Mon, 27 Aug 2018 13:56:08 +0200 Message-Id: <1535370968-217716-1-git-send-email-imammedo@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: libvir-list@redhat.com, pbonzini@redhat.com, drjones@redhat.com, ehabkost@redhat.com Subject: [libvirt] [PATCH] vl.c deprecate incorrect CPUs topology 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Mon, 27 Aug 2018 11:56:20 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" -smp [cpus],sockets/cores/threads[,maxcpus] should describe topology so that total number of logical CPUs [sockets * cores * threads] would be equal to [maxcpus], however historically we didn't have such check in QEMU and it is possible to start VM with an invalid topology. Deprecate invalid options combination so we can make sure that the topology VM started with is always correct in the future. Users with an invalid sockets/cores/threads/maxcpus values should fix their CLI to make sure that [sockets * cores * threads] =3D=3D [maxcpus] Signed-off-by: Igor Mammedov --- qemu-deprecated.texi | 11 +++++++++++ vl.c | 6 ++++++ 2 files changed, 17 insertions(+) diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi index 87212b6..d5d9ce6 100644 --- a/qemu-deprecated.texi +++ b/qemu-deprecated.texi @@ -159,6 +159,17 @@ The 'file' driver for drives is no longer appropriate = for character or host devices and will only accept regular files (S_IFREG). The correct driver for these file types is 'host_cdrom' or 'host_device' as appropriate. =20 +@subsection -smp X,[socket=3Da,core=3Db,thread=3Dc],maxcpus=3DY (since 3.1) + +CPU topology properties should describe whole machine topology including +possible CPUs. but historically it was possible to start QEMU with +an incorrect topology where + socket * core * thread >=3D X && < maxcpus +which could lead to incorrect topology enumeration by the guest. +Support for invalid topology will be removed, end user must ensure +that topology described with -smp includes all possible cpus, i.e.: + socket * core * thread =3D=3D maxcpus + @section QEMU Machine Protocol (QMP) commands =20 @subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0) diff --git a/vl.c b/vl.c index 5ba06ad..bc53828 100644 --- a/vl.c +++ b/vl.c @@ -1238,6 +1238,12 @@ static void smp_parse(QemuOpts *opts) exit(1); } =20 + if (sockets * cores * threads !=3D max_cpus) { + warn_report("Invalid CPUs topology deprecated. " + "sockets (%u) * cores (%u) * threads (%u) " + "!=3D maxcpus (%u)", + sockets, cores, threads, max_cpus); + } if (sockets * cores * threads > max_cpus) { error_report("cpu topology: " "sockets (%u) * cores (%u) * threads (%u) > " --=20 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list