From nobody Mon Feb 9 01:00:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1595411118; cv=none; d=zohomail.com; s=zohoarc; b=eN1vh95A6viAsb1E1T3a4im6SZCm3WP6ehYYN1Pw+9cNihlANGOOEnEGIqcZGxFFhP9Zjbrev2E06l/YgMM8uNLwzXzK56Tn/qL91jeEibXSXxMSR73xL5ddONmz1Kz8fxUhZCwOHNW5S4gwDtXPToe6R2f8cvObuFvKOGVasww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595411118; 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=tL/a2ua5B3GdPK65BeOqhzV4D9NZK1POSoToHDXZ15Q=; b=PEsZCiW5v6JyNXWt56LRxE2BSfLuEAx5k/o4ljm4XJ0TwGmmtpm4fX95R7kQaC4QftGTzyuUHIIe/cquNMWvuMpcg/r8S3v5DHatxmFBU3YsHtwagnil8UKKfkTRBh1utRnFVc+iOdUg/5kv4bUOG0Yii7vk3hwqvC4gvoGeG1k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595411118931923.7553112457182; Wed, 22 Jul 2020 02:45:18 -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-208-3ub6rQaNNymysPIsD7trjQ-1; Wed, 22 Jul 2020 05:44:21 -0400 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 9D6F759; Wed, 22 Jul 2020 09:44:16 +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 791A61001B0B; Wed, 22 Jul 2020 09:44:16 +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 482901800B72; Wed, 22 Jul 2020 09:44:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06M9fF5h001150 for ; Wed, 22 Jul 2020 05:41:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id A9EBC2DE81; Wed, 22 Jul 2020 09:41:15 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id 28AC22DE80 for ; Wed, 22 Jul 2020 09:41:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595411117; 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=tL/a2ua5B3GdPK65BeOqhzV4D9NZK1POSoToHDXZ15Q=; b=bcrZVsVYNiOKvx29eBpRLP42pOISqXTZQD/hv+EyiGO4FFAIVxnLaDpXUeOzLUxWgcum/g tOGvrzISu9keJQxwkmstNyhAxKxPXhQxW9WHWg0wkTnEUg3Wkk1ojOD41llUJ69tt7esQP XoVhKX0gOzJseaciNLEr08vbufQXMVQ= X-MC-Unique: 3ub6rQaNNymysPIsD7trjQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 31/34] qemuDomainNamespaceTeardownMemory: Deduplicate code Date: Wed, 22 Jul 2020 11:40:25 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.84 on 10.5.11.22 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" We can use qemuDomainSetupMemory() to obtain the path that we need to unlink() from within domain's namespace. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain_namespace.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namesp= ace.c index 8251554e73..aaf45859d3 100644 --- a/src/qemu/qemu_domain_namespace.c +++ b/src/qemu/qemu_domain_namespace.c @@ -1492,13 +1492,15 @@ int qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm, virDomainMemoryDefPtr mem) { + VIR_AUTOSTRINGLIST paths =3D NULL; + if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) return 0; =20 - if (mem->model !=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM) - return 0; + if (qemuDomainSetupMemory(mem, &paths) < 0) + return -1; =20 - if (qemuDomainNamespaceUnlinkPath(vm, mem->nvdimmPath) < 0) + if (qemuDomainNamespaceUnlinkPaths(vm, (const char **) paths) < 0) return -1; =20 return 0; --=20 2.26.2