From nobody Sun Feb 8 19:59:40 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=1619184432; cv=none; d=zohomail.com; s=zohoarc; b=ag9VQM+cklsntip+/FJ5zwPX/0i5O+3hpHVS3KibpbHCBylIM9vRfrbVCAbKHtBACyqeDasKeylDTSw7Wy5CTnpQLuExeMs+Lv59LrQoYT2iwjFuID6W4Wq7AA2O3mZWIth4Yr9s/dCfyh2zTeD383RNrSNVtvme75m6Z+izQnM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619184432; h=Content-Type:Content-Transfer-Encoding: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=eUKbgOuVLifY1eECl4VTK2fGnRn+fmKindEYPu43EP0=; b=c6WdN1Q40Yzi3yS84LRrT1dEaYJyeAdkST+Ce3+aWZ4P3odqD6t7jj1GVW0xljH3uTykR/qjipVImWvRpeKvLbwH4zWiYzljX6PrLjWxkFydACSJvESgtOB9f51W5bvVCoAYrXq83qoxY6tqFiZaoDSOcPhXcBUQQ3xsChIt030= 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 1619184432338363.9682751628901; Fri, 23 Apr 2021 06:27:12 -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-572-j1Cu878NNg6VzVm3hJovoA-1; Fri, 23 Apr 2021 09:24:52 -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 E3B21817469; Fri, 23 Apr 2021 13:24:47 +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 C19BF60C17; Fri, 23 Apr 2021 13:24:47 +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 8FFFC1806D1F; Fri, 23 Apr 2021 13:24:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 13NDOi9U021532 for ; Fri, 23 Apr 2021 09:24:44 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4C0A36A8E4; Fri, 23 Apr 2021 13:24:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id BD0486A8F9 for ; Fri, 23 Apr 2021 13:24:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619184296; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eUKbgOuVLifY1eECl4VTK2fGnRn+fmKindEYPu43EP0=; b=jNODSsNRjIxjPP/maRBrKXR9TJ1806D811QFLdyunv2VH1+WB0vWbR9okB4dF4EqLfCKtg rN/aFrW5iM3O7oqflF8NDFWLj7AECnZG3ClKkiYLhFaXmlz53ULEJht74sQqq+lxKa8KtX eB5qjdtByeUeVlRTPADIiFuwUmqYDsE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1619184431; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=eUKbgOuVLifY1eECl4VTK2fGnRn+fmKindEYPu43EP0=; b=XEDjwm8SDnBXhV6biGUjTdl+NtnQBOgW6KCE7o60E6GX/Z9LMSrVR0flVAWnDDSyznTdlE C/elLSDUBqT1UK7cc+c2M2/ybwwatA/W+EfWUgg3dMytgq4lbWZywyoRz2MWTch3YCt3vd N523Y0xbvGnqqdPNpQ4lSctqq/AWnec= X-MC-Unique: j1Cu878NNg6VzVm3hJovoA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v3 03/14] qemu_process: Drop needless check in qemuProcessNeedMemoryBackingPath() Date: Fri, 23 Apr 2021 15:24:25 +0200 Message-Id: <352c747a54cd6ac810e605a60aba2c1babd11a87.1619184154.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@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) (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 449e5f1547..a5f256154f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3939,13 +3939,24 @@ qemuProcessNeedMemoryBackingPath(virDomainDef *def, 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.3