From nobody Mon Feb 9 12:11:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1595413746; cv=none; d=zohomail.com; s=zohoarc; b=XKgiOhP0TFceVolG/4u727eVOwTk5gnuhvlOWcJ1d33TClj4QDdx+vUdtMQP50g9Jevd4Du6ufvtSCyyuWFQwnEv38kcqlLFI4FW0b0rBat36ti9W/sw1zRpdSAU1v9TUZV+9skxUBE8p5Vpy/NP35mDMVPPg/Y9XprD/0pRLcs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595413746; 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=NVaGItYKOX8LfuIPZszdfKHrccRwMt//THbWZ4mfumE=; b=WHaekec7aJS28ANwZ8ABZlvxO82hgZZAnW/T+PWfQLuPTmguFxqAYc5uCiYg/LdSjWTS1Qixnp86/X85LMH2ljIcZBuVX2quAeohehYKZYTwKUVA8UEj4ZNi48OLIi4ieJ7rtzrg9601iwAyIuxd6X1EIgQokdUDe/WdqYlTtFw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1595413746678329.19066156314886; Wed, 22 Jul 2020 03:29:06 -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-204-Y9w-FrWpOiqq6opEshk2fg-1; Wed, 22 Jul 2020 06:28:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC71C102C7EE; Wed, 22 Jul 2020 10:28:15 +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 CC4FC872FB; Wed, 22 Jul 2020 10:28:15 +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 969BE1806B0C; Wed, 22 Jul 2020 10:28:15 +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 06M9fIfD001189 for ; Wed, 22 Jul 2020 05:41:18 -0400 Received: by smtp.corp.redhat.com (Postfix) id 51A841A90F; Wed, 22 Jul 2020 09:41:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.120]) by smtp.corp.redhat.com (Postfix) with ESMTP id C05852DE80 for ; Wed, 22 Jul 2020 09:41:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595413745; 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=NVaGItYKOX8LfuIPZszdfKHrccRwMt//THbWZ4mfumE=; b=BxbSwYwaziGpZdIQKDSjsgj17Wm+Bg1it4FcSr8DO8cLOEylnlCE6vq9ed95MWlHWvI8rd aCCGtQo8jEnTZdfmxdcKlDEOVqFd+DuPe0LDXhtoYGdjRAqm0lCBXHKKQnDxRGv5DDDcvB oUFwlD4IMDdNVpHQ8djLFHZl9x/L4Gc= X-MC-Unique: Y9w-FrWpOiqq6opEshk2fg-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 34/34] qemuDomainNamespaceTeardownInput: Deduplicate code Date: Wed, 22 Jul 2020 11:40:28 +0200 Message-Id: <80659a585fe0dc8e13662122f99128197ad2cf63.1595410402.git.mprivozn@redhat.com> 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.79 on 10.5.11.13 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 qemuDomainSetupInput() 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 | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_domain_namespace.c b/src/qemu/qemu_domain_namesp= ace.c index 89d73b26ef..51d3497670 100644 --- a/src/qemu/qemu_domain_namespace.c +++ b/src/qemu/qemu_domain_namespace.c @@ -1360,16 +1360,6 @@ qemuDomainNamespaceUnlinkPaths(virDomainObjPtr vm, } =20 =20 -static int -qemuDomainNamespaceUnlinkPath(virDomainObjPtr vm, - const char *path) -{ - const char *paths[] =3D { path, NULL }; - - return qemuDomainNamespaceUnlinkPaths(vm, paths); -} - - int qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, virStorageSourcePtr src) @@ -1605,15 +1595,15 @@ int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, virDomainInputDefPtr input) { - const char *path =3D NULL; + VIR_AUTOSTRINGLIST paths =3D NULL; =20 if (!qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) return 0; =20 - if (!(path =3D virDomainInputDefGetPath(input))) - return 0; + if (qemuDomainSetupInput(input, &paths) < 0) + return -1; =20 - if (path && qemuDomainNamespaceUnlinkPath(vm, path) < 0) + if (qemuDomainNamespaceUnlinkPaths(vm, (const char **) paths) < 0) return -1; =20 return 0; --=20 2.26.2