From nobody Mon Feb 9 06:49:25 2026 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=1615982270; cv=none; d=zohomail.com; s=zohoarc; b=lnkf0dowdosoa/jvU6hhmS05ryfTIOM/OelP07MzWEHMikuZgqmHDHp+wNKurBRhdThabsHxjaU9ne+cbfrN4Pctu+Ssa5bAgtgFBEfIiboGFYbbL79+6tHJgrF/lbsidpinG7MThyQmw/ghhxus8TCh15+z3LTBTt/MDrzOMPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615982270; 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=TdRIrYKN8VqXpT35YHgk8Fi4wFgOC+/hWniehXNTgNY=; b=PXFkqMnTUNRt37r7hn60zbo3S9XHX20pzHHj4saUDvYCvnczwbcNF9ku4hm4We+HCoM5xmxgMM6ayynakuRioG6tz8jO/3P6zoO07VW56QEc9UKAI/+nVFOYFDkusp16QJE4pG/MS+yErDXZONek3E3vRj+W+m6o/myWEOBHsg8= 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) header.from= 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 161598227004191.2247156235037; Wed, 17 Mar 2021 04:57:50 -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-266-KBvSKolTP1uNsFpo4l4ckw-1; Wed, 17 Mar 2021 07:57:46 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 969F183DD34; Wed, 17 Mar 2021 11:57:41 +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 9E3DB2B1A1; Wed, 17 Mar 2021 11:57:40 +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 1DF491800215; Wed, 17 Mar 2021 11:57:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12HBvbpH028257 for ; Wed, 17 Mar 2021 07:57:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id A496B101E249; Wed, 17 Mar 2021 11:57:37 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.148]) by smtp.corp.redhat.com (Postfix) with ESMTP id F112D1017CF5; Wed, 17 Mar 2021 11:57:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615982268; 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=TdRIrYKN8VqXpT35YHgk8Fi4wFgOC+/hWniehXNTgNY=; b=NDO4taWaZZ/vcI4+j8oqOsJ5V7+w1IHPX0QvLnBLJlI8HUunOb4KQLJyw8J2ouATahjc/+ hL98A181Aysv+W6r+nh1skJf5nmHGdnPc3w7Syphqywq7cnLsvdLUP18KhuqQNyaA7powV 95SjrdNx7BCmi1ZOAKI5nZZOa5Nzh/k= X-MC-Unique: KBvSKolTP1uNsFpo4l4ckw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 03/15] qemu_process: Drop needless check in qemuProcessNeedMemoryBackingPath() Date: Wed, 17 Mar 2021 12:57:13 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 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.79 on 10.5.11.12 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 74667206b9..7eeeeead33 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3929,13 +3929,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