From patchwork Thu Dec 19 14:38:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 1213470 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="Ng5tnbUq"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47dvfb5F7Bz9sPc for ; Fri, 20 Dec 2019 01:39:51 +1100 (AEDT) Received: from localhost ([::1]:42802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihwxw-0004o5-UK for incoming@patchwork.ozlabs.org; Thu, 19 Dec 2019 09:39:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56883) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihwws-0004gT-Cn for qemu-devel@nongnu.org; Thu, 19 Dec 2019 09:38:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ihwwr-0005GK-9U for qemu-devel@nongnu.org; Thu, 19 Dec 2019 09:38:42 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:24618 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ihwwr-0005DF-1i for qemu-devel@nongnu.org; Thu, 19 Dec 2019 09:38:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576766320; h=from:from: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; bh=Dk61yWfDOddI3UUwPOJpvkQE7B71zRPhPnSg+tPhN/o=; b=Ng5tnbUqMQzA3YVG5L5Zt1umJOtGEgcTxD5EFFmtxyxYQBm1SzhTk0Fwbdh7MTRSiIQ/w4 Kmxi1mTO9G//aWM/VJEFmLVoFMJCi4d7NVMlpdhASsIn/6dUaDvDhYnOZFk3azyfgS03Vf bYUnxRQvJZGhoHqcX7I0b4dK00jfocM= 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-358-UCr0XucYO2Cx6mzpuCd-iA-1; Thu, 19 Dec 2019 09:38:38 -0500 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 0EDAE802B93; Thu, 19 Dec 2019 14:38:38 +0000 (UTC) Received: from localhost (ovpn-205-138.brq.redhat.com [10.40.205.138]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BD5CE60C81; Thu, 19 Dec 2019 14:38:36 +0000 (UTC) From: Max Reitz To: qemu-block@nongnu.org Subject: [PATCH 04/18] fuse: Add fuse-export-remove Date: Thu, 19 Dec 2019 15:38:04 +0100 Message-Id: <20191219143818.1646168-5-mreitz@redhat.com> In-Reply-To: <20191219143818.1646168-1-mreitz@redhat.com> References: <20191219143818.1646168-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: UCr0XucYO2Cx6mzpuCd-iA-1 X-Mimecast-Spam-Score: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Max Reitz --- block/fuse.c | 16 ++++++++++++++++ qapi/block.json | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/block/fuse.c b/block/fuse.c index f18e8e7591..4e662e6dfb 100644 --- a/block/fuse.c +++ b/block/fuse.c @@ -123,6 +123,22 @@ fail: close_fuse_session(session); } +void qmp_fuse_export_remove(const char *mountpoint, Error **errp) +{ + BdrvFuseSession *session = NULL; + + if (sessions) { + session = g_hash_table_lookup(sessions, mountpoint); + } + + if (!session) { + error_setg(errp, "No export found on '%s'", mountpoint); + return; + } + + g_hash_table_remove(sessions, mountpoint); +} + /** * Drop all FUSE exports. */ diff --git a/qapi/block.json b/qapi/block.json index 03f8d1b537..26768dc8ef 100644 --- a/qapi/block.json +++ b/qapi/block.json @@ -340,6 +340,21 @@ }, 'if': 'defined(CONFIG_FUSE)' } +## +# @fuse-export-remove: +# +# Unmount an exported block graph node. +# +# @mountpoint: The export path given to fuse-export-add +# +# Since: 5.0 +## +{ 'command': 'fuse-export-remove', + 'data': { + 'mountpoint': 'str' + }, + 'if': 'defined(CONFIG_FUSE)' } + ## # @DEVICE_TRAY_MOVED: #