From nobody Sat May 18 08:35:50 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=1689257481; cv=none; d=zohomail.com; s=zohoarc; b=XHOWkCFKwOH86kWcBQeRsUepECJl6qefEVeWamwoM911X6POECH1M6pYHvTLECClmYoUn+WDiYA2Rl4rTMB8wG5VWVRqC8b+LQksvRVTa6+9NThajZtmn4AxbMN+DGGMuGH1TLep/9o5i8zae11Sicsr98tny/46Qxw8OHBDj10= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689257481; 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=AidafUR/ZcrJ9aegHNZoXZfgcQn1KkJNiCNbYiyCXTw=; b=G95ctOdvJqhJoctrq/G7n9i3ARlx0meoYcLrxcSxFbFSVTzjg4tw1hk9OwIm6Ucwg6rHKG6p3Im8Ni5F7yLf99sosthXavmjvgvFdYTlAklJE/WI22aAX3otFy8Bx+xtMMPVGor6hpYS4grt54UJ2QgEdY2rlJU6IuuA3wUXnqQ= 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 1689257481155267.51205640261674; Thu, 13 Jul 2023 07:11:21 -0700 (PDT) Received: from mimecast-mx02.redhat.com (66.187.233.73 [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-636-bwMgDk3INP2opau6icNSoA-1; Thu, 13 Jul 2023 10:10:25 -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 47E381C17127; Thu, 13 Jul 2023 14:04:55 +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 2DE7E2166B26; Thu, 13 Jul 2023 14:04:55 +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 77B6D19452C1; Thu, 13 Jul 2023 14:04:21 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3F7A71946589 for ; Thu, 13 Jul 2023 08:48:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 34A2C111E3EB; Thu, 13 Jul 2023 08:48:06 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0B25111E3EA for ; Thu, 13 Jul 2023 08:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689257480; 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=AidafUR/ZcrJ9aegHNZoXZfgcQn1KkJNiCNbYiyCXTw=; b=XDb3Zg4hoAs7NP8SUJ9GRGgHfVI+0b/aiGGI9Bpjc1DUDfqxqF1su0YFge+qByNCZq8fG3 +7G76P9+E0JzWfe9y6q3jjG0v2MhuMZp+vKDI+PGlGraZ4bR3Zou2CGMH5XSO5iLmuKref kqZBfpBtUr/YkoOAWwkhZ9ndZ7jgn1U= X-MC-Unique: bwMgDk3INP2opau6icNSoA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_domain: Deduplicate targetNode check in qemuDomainDefValidateMemoryHotplugDevice() Date: Thu, 13 Jul 2023 10:48:03 +0200 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1689257528862100001 Content-Type: text/plain; charset="utf-8"; x-default="true" If a domain has NUMA configured, then all devices (except for 'virtio-pmem') need to have targetNode set. There are two checks inside of qemuDomainDefValidateMemoryHotplugDevice() for this: one inside of big switch() statement, which only checks 'dimm' and 'nvdimm' cases, and the other at the end of the function that checks all models (except for 'virtio-pmem'). Let's keep the latter and remove the former as the latter covers the former too. Signed-off-by: Michal Privoznik Reviewed-by: Kristina Hanicova --- src/qemu/qemu_domain.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 94587638c3..3700b3e711 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9189,15 +9189,6 @@ qemuDomainDefValidateMemoryHotplugDevice(const virDo= mainMemoryDef *mem, return -1; } =20 - if (virDomainNumaGetNodeCount(def->numa) !=3D 0) { - if (mem->targetNode =3D=3D -1) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("target NUMA node needs to be specified f= or " - "memory device")); - return -1; - } - } - if (mem->info.type =3D=3D VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) { if (mem->info.addr.dimm.slot >=3D def->mem.memory_slots) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, --=20 2.41.0