From nobody Sun Feb 8 22:53:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1613655107; cv=none; d=zohomail.com; s=zohoarc; b=CMzALyR7+z+wSz0ia6QNuDbAGehfFxESZMAyaCjRgad2/eIBVR8HO0I+u/f6UZM2sJvOLE4UpdaONxrWzIxOyBihUEVUPckFt8I5jJGMoRLoaiTh7gIzHNEfB1LKltZP/xajtdguomcGKFJ4bo4JP3g4YMOdhXG7RfTQd1j8R0s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613655107; 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=IOSm3in7U55dDhNTeMrMj+jV+gW8TS4pZfWi11cOoCo=; b=fBZa1aj5sf8DCkEzu9DUiGcW32z/u+fW87fPYDx9Pgm3a/2cngP3GsBfQTot5p3nfokrmaE00nsT6vIRWXAgYj3N20PF1/YVVasGLSjln+CZR3mvrjigAIyBmfGGzvCm5QVcDmPZ/qU2bFMOmuoXbQEQZEWMieLvq/XOjsWi4LU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1613655107231572.4313499457086; Thu, 18 Feb 2021 05:31:47 -0800 (PST) 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-340-7ZD3v-bfMLi_M_aOgAwWIw-1; Thu, 18 Feb 2021 08:31:43 -0500 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 BE99A80196C; Thu, 18 Feb 2021 13:31:38 +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 976E51007623; Thu, 18 Feb 2021 13:31:38 +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 5D90E1809C92; Thu, 18 Feb 2021 13:31:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 11IDVMu1022107 for ; Thu, 18 Feb 2021 08:31:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 649342C01F; Thu, 18 Feb 2021 13:31:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.194.32]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF6B82BFE9; Thu, 18 Feb 2021 13:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613655106; 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=IOSm3in7U55dDhNTeMrMj+jV+gW8TS4pZfWi11cOoCo=; b=AFfGKwTLj0i3PQ1m2NK2qj3KKa+2SUy7/uDDjsPgVijhb5uXxCV+mwHqZf/RZptSUiU0Yx QUaCZyhKK7b4dNsep3kIfz+vg05WXClmv7maecnjt1tlYihD0u0sBLfCiM2jpyM7vqo4Q0 5AQg2i6v0JkmDWR2cH6UdnfR2uGIF/Q= X-MC-Unique: 7ZD3v-bfMLi_M_aOgAwWIw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v2 03/13] qemu_process: Drop needless check in qemuProcessNeedMemoryBackingPath() Date: Thu, 18 Feb 2021 14:30:58 +0100 Message-Id: <0a14f6b2ad4b860cf450fd58d5f7d1d94242c6bf.1613654814.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: david@redhat.com 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com 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" The aim of this function is to return whether domain definition and/or memory device that user intents to hotplug needs a private path inside cfg->memoryBackingDir. The rule for the memory device that's being hotplug includes checking whether corresponding guest NUMA node needs memoryBackingDir. Well, while the rationale behind makes sense it is not necessary to check for that really - just a few lines above every guest NUMA node was checked exactly for that. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 6a223e18c2..066f153703 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3930,13 +3930,24 @@ qemuProcessNeedMemoryBackingPath(virDomainDefPtr de= f, return true; } =20 - if (mem && - mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_DIMM && - (mem->access !=3D VIR_DOMAIN_MEMORY_ACCESS_DEFAULT || - (mem->targetNode >=3D 0 && - virDomainNumaGetNodeMemoryAccessMode(def->numa, mem->targetNode) - !=3D VIR_DOMAIN_MEMORY_ACCESS_DEFAULT))) - return true; + if (mem) { + switch (mem->model) { + case VIR_DOMAIN_MEMORY_MODEL_DIMM: + if (mem->access !=3D VIR_DOMAIN_MEMORY_ACCESS_DEFAULT) { + /* No need to check for access mode on the target node, + * it was checked for in the previous loop. */ + return true; + } + + case VIR_DOMAIN_MEMORY_MODEL_NONE: + case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM: + case VIR_DOMAIN_MEMORY_MODEL_LAST: + /* Backed by user provided path. Not stored in memory + * backing dir anyway. */ + break; + } + } =20 return false; } --=20 2.26.2