From nobody Sat May 18 01:11:44 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=1669382470; cv=none; d=zohomail.com; s=zohoarc; b=bsJdjJfA2aUo81UGouA9am0HxKpCApsBH6natPssos2DNtgOnhorJdOXN9w6eYzIzHOVenE0cjDjK+ftdL4RmTI3Xyi920aX5PpM6UB4PKMKsbAtR2Iu3oSrdP5yL1GEr7qcKLQo3xU4SDW78BWSr914eGst9z3ST9lpnNVpdNg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1669382470; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=kMFtjvuP+2NeZ0MIU+NabH7GbfzxIdTJ24YiH6uuFDw=; b=mFrpzeqtTnJKaE17VEntKo9GQUnFu3RoAs4GVFQvklf76IsCd97p3ba/sfaKxV6M1Mw21rQdbBZ+871DLXHCA0qlZF53mhHfvuKpXmPM3toS1qDK+WSx+tMCcncsIFEmTNsBUKJIUfuMKKaLHkAOEuFZksDCP+YgBu+eQTHX1ns= 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 1669382470364737.4261437344684; Fri, 25 Nov 2022 05:21:10 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-36-iwwKJezgNVSkXu8hq9Lwnw-1; Fri, 25 Nov 2022 08:21:05 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 372A3293249F; Fri, 25 Nov 2022 13:21:03 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A5583492B08; Fri, 25 Nov 2022 13:21: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 86602194658C; Fri, 25 Nov 2022 13:21:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 46D481946589 for ; Fri, 25 Nov 2022 13:20:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 185E740C2088; Fri, 25 Nov 2022 13:20:59 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id B156D40C2064 for ; Fri, 25 Nov 2022 13:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669382468; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kMFtjvuP+2NeZ0MIU+NabH7GbfzxIdTJ24YiH6uuFDw=; b=b8YWKNWVvMKTEDCdi3GFwzmSq+It8HGj3GwxTku8jte++svptfWIZ4Ek7+JKF+K65oYBTg 2JImtQTapHVUEnESfzy0Y9ZOB9lkoXtit3Xob33mDI1i6wGr4Sr+zhQbmstFehfE/SFKL5 ShLkjQFuXbC6iGr4+3TnZQ6HOqpg9pM= X-MC-Unique: iwwKJezgNVSkXu8hq9Lwnw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] conf: report no NUMA nodes when attaching memory device Date: Fri, 25 Nov 2022 14:20:53 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1669382472479100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Error message reports that the guest has '0' NUMA nodes configured when trying to attach a memory device to a guest with no NUMA nodes. This may be a little misleading because '0' can also be node's id. A more friendly way is to directly report that the guest has no NUMA nodes. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D2142519 Signed-off-by: Kristina Hanicova Reviewed-by: Jiri Denemark --- src/conf/domain_validate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 5bc7ea10aa..95b8d9b419 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2257,6 +2257,12 @@ virDomainMemoryDefValidate(const virDomainMemoryDef = *mem, if (mem->targetNode !=3D -1) { const size_t nodeCount =3D virDomainNumaGetNodeCount(def->numa); =20 + if (nodeCount =3D=3D 0) { + virReportError(VIR_ERR_XML_DETAIL, "%s", + _("can't add memory backend as guest has no NUM= A nodes configured")); + return -1; + } + if (mem->targetNode >=3D nodeCount) { virReportError(VIR_ERR_XML_DETAIL, _("can't add memory backend for guest node '%d'= as the guest has only '%zu' NUMA nodes configured"), --=20 2.38.1