From nobody Fri May 17 11:29:10 2024 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=1672933059; cv=none; d=zohomail.com; s=zohoarc; b=V1ZVe9NYLR7N6iVRkXDmSsJoe/36sskkYbepDK/MnJ3ItdhU2isQbV2HE9WvxDNd23PJIPkNECQLpJJceoXmaHrWVXjq+XvImeS3UKSomGXC+PSVV0MLjNJvQFq/XV0Kd+okKUkWLP8hoYs1Kp+4aQ8cXI8kE6gCsm/GD6PxKqU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672933059; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=5pjxaeazzXFijr8tb/c/M+kLhvq38vkb4yn6rgacfD0=; b=PLgRYfgh2cEJCqhnKeZunt69PcL4CsEHV2jG7k9aO4Ut9Tz57cnWTIFi75e6WDOb1R0psqX4HvC+6Np1+7IHYP0s5xkQ23Ax0wa9H3ilRN0Ne4zQlON6/SsHVUbJ2gTryGOavC79w5whLVopFacvE/CXH1jG2iKjKR04AuoNz3g= 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) 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 1672933059680467.16940215662567; Thu, 5 Jan 2023 07:37:39 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-648-haE-fgMEPiKrRd29SUwliw-1; Thu, 05 Jan 2023 10:37:35 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 883E91C08987; Thu, 5 Jan 2023 15:37:33 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49FD014152F6; Thu, 5 Jan 2023 15:37:31 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 16F651946589; Thu, 5 Jan 2023 15:37:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3622D1946586 for ; Thu, 5 Jan 2023 15:37:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 13AC340C2005; Thu, 5 Jan 2023 15:37:29 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id B008340C2064 for ; Thu, 5 Jan 2023 15:37:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672933058; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5pjxaeazzXFijr8tb/c/M+kLhvq38vkb4yn6rgacfD0=; b=ZotA5knrYRvXM0Uw3grqiQbfHz4BcjFR2jO4/tl7L5+xaqubpRpVHa4h0JlOgNVPFLFSly bzAi3QqFBBMWFTOmCzV1atIyOE2sOVXm4e9YVUWyFpPg3iiGxJh0T9NhpG7NrvUIkJWjKb wnM0KC0+KxIW2pqHuTqnLBmHNk8GsJo= X-MC-Unique: haE-fgMEPiKrRd29SUwliw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_namespace: Move umount() call into #fdef __linux__ Date: Thu, 5 Jan 2023 16:37:26 +0100 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1672933060884100001 Content-Type: text/plain; charset="utf-8"; x-default="true" In a recent commit I've introduced an umount() call. But the function where the call lives is compiled on all OSes, not just Linux. But umount() is Linux specific. Other OSes have unmount (FreeBSD), or maybe something else. But since namespaces are Linux specific, we can wrap the call in #ifdef __linux__ and not care about other OSes. Signed-off-by: Michal Privoznik --- src/qemu/qemu_namespace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index fc348c043e..5769a4dfe0 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -776,10 +776,12 @@ qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg, goto cleanup; } =20 +#if defined(__linux__) if (umount("/dev") < 0) { virReportSystemError(errno, "%s", _("failed to umount devfs on /de= v")); return -1; } +#endif /* !defined(__linux__) */ =20 if (virFileMoveMount(devPath, "/dev") < 0) goto cleanup; --=20 2.38.2