{"id":2197740,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2197740/?format=json","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.0/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260218132633.29748-6-hreitz@redhat.com>","date":"2026-02-18T13:26:14","name":"[v4,05/24] fuse: Change setup_... to mount_fuse_export()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9851189b3816dcd81352eb7519895a985a29894d","submitter":{"id":82279,"url":"http://patchwork.ozlabs.org/api/1.0/people/82279/?format=json","name":"Hanna Czenczek","email":"hreitz@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260218132633.29748-6-hreitz@redhat.com/mbox/","series":[{"id":492547,"url":"http://patchwork.ozlabs.org/api/1.0/series/492547/?format=json","date":"2026-02-18T13:26:09","name":"export/fuse: Use coroutines and multi-threading","version":4,"mbox":"http://patchwork.ozlabs.org/series/492547/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2197740/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=cAO5cgZR;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=d07ER0GU;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGHWr4C9Rz1xyD\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 19 Feb 2026 00:33:12 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1vshfC-0003rZ-M3; Wed, 18 Feb 2026 08:32:22 -0500","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <hreitz@redhat.com>) id 1vshfB-0003pa-4L\n for qemu-devel@nongnu.org; Wed, 18 Feb 2026 08:32:21 -0500","from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <hreitz@redhat.com>) id 1vshf2-0005GZ-HR\n for qemu-devel@nongnu.org; Wed, 18 Feb 2026 08:32:16 -0500","from mail-wm1-f72.google.com (mail-wm1-f72.google.com\n [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-685-MYc6KdwxPwWBjvj89X6qLw-1; Wed, 18 Feb 2026 08:26:57 -0500","by mail-wm1-f72.google.com with SMTP id\n 5b1f17b1804b1-48379489438so43583655e9.2\n for <qemu-devel@nongnu.org>; Wed, 18 Feb 2026 05:26:56 -0800 (PST)","from localhost\n (p200300cfd737d029edef7b8da7441ac2.dip0.t-ipconnect.de.\n [2003:cf:d737:d029:edef:7b8d:a744:1ac2])\n by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4834d482480sm624827305e9.0.2026.02.18.05.26.53\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 18 Feb 2026 05:26:54 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1771421527;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=BOixUczgf/re8Xp6Djr53L45pCSu7AEC5w4EK2f/CNY=;\n b=cAO5cgZRzvNYp9QZORU0O6EbC9d06zYUXCdWIxrd18bhWNJh1pY+QuNPQxBFguUoExcTE5\n IsksItraou6oIRP9A9XTatwCzSL6OrzBZzh065Smq3YPAzij7FTKXUQXPPTJ1KZ0G8U95s\n AFSYbOdrKbRByNJ9WHYSMv+nyjCwZFE=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1771421216; x=1772026016; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=BOixUczgf/re8Xp6Djr53L45pCSu7AEC5w4EK2f/CNY=;\n b=d07ER0GU+tvnG9/0oDjiFekc5wUhaRtQ4GEqIlma1DjV1cVxO7lFx2wJyWkUd4znUR\n k7CAkfLXNP6k8YUn0IrZobMnARZgJkT+0hUjjnNWNDVAcPwhYA4JOtheA/DtDeE67D+7\n IAkdiHf14ATvgMWfq97BHgJHAg00QJ9tZghC2kSpuslzk7M+TS8TVGwKlLEjddtTdCrH\n 8JKMG5xBTiTv39BtcXj+l9gzQEQqLjcutjly6MuQAYSr4cgWuktoFWpUCCUcX0I3JNS8\n 82cFxlnacvbfOJNAPjc6e3t4PgdJqvxaJ6/qI/MhNRt6DUo0U623DP9Eet2T19mS9kgV\n bRPw=="],"X-MC-Unique":"MYc6KdwxPwWBjvj89X6qLw-1","X-Mimecast-MFC-AGG-ID":"MYc6KdwxPwWBjvj89X6qLw_1771421216","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1771421216; x=1772026016;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=BOixUczgf/re8Xp6Djr53L45pCSu7AEC5w4EK2f/CNY=;\n b=eAHZuyH54f1mwV4HnAdqa33+3PT+m2fb4uILfB28oX6KHUVaicuUbxSOPVxiNnmbJ/\n hzGGJ8H4oLu4BFh0tRv6P8am25A/UDayBCAvnltciNDML2DKCRFqUqJ+ii+2hHCU+ynM\n oYcEpzTxBSULgE3hd+1XPkJo1Uax5Bo/9ZfK3aSPEnjFVu1Pw1huDmES/bp+zlN+aeaX\n 5AsWb6NiGFrun8vA5yNBpO6NS4/q6JTFml/W0cOvLtifYsh2VxXQrvDN3vrQJExu94P8\n 3+E9t0HnEpu3NPn+LbmmbWV6z+69Z7Q+NF27pFpy3tGcnDusgA4lbXIR7bOokgEz5SW0\n r8Pg==","X-Gm-Message-State":"AOJu0YxyRwjeYK/YFZmqYaqb6/24JCOlBW+cbW5YqOHT/54hWO1CF0vv\n 85SqwSddyoHvGthaWCyCk4MpLNcmQlyEXtCD1fWHEwBjiHr6Jj+NoNVeTZd0uOA1N21cFN4RwqY\n eYhX0aphgXviXLgenQdKVklgRO80SclUt38hnTCq9VkUp6cRGPTB+RJaS","X-Gm-Gg":"AZuq6aJxiyoTDzKlDyHnFYNWe4MjPfauhrZ5wOs2w9uw6YNx1wKe7Af0K1WfSUYWQ/9\n 5WO0P5O8urO3GDsRtLEVailhBKItUcvmkiec5G1qoqBMmhA1eykWFGM2N3npgsVbTDSgyenPWWN\n xRMqF8k/yiDFEyHnY8dA7bwf679510cZIxVI/huhHp0envZtF0j+AN8bky97zzLGrQQUFbJXdw/\n ydXPa0+iwwzHoZmsNbNzdGkH5qsfciiqgnf72/lvns0Jo24TWLHuOHB7OMzP6ygly+Wzyi/KzAB\n MXz6sbEXFPPAv9+lZG6EDhgHaqEiTSNWe3vGatlgr2q4tfuS1EyvkJ+1s5c76c+Kx+h+aHw3VpD\n 5S2Iu8doocsD/XgJiKPMrmOI1cm9wA3fLi9wXvniKZ9iTik5f4zjA7XrJCgJD+QC8P5AaS22rPz\n VeYLM1","X-Received":["by 2002:a05:600c:5295:b0:483:9139:4c29 with SMTP id\n 5b1f17b1804b1-48398a48450mr31689685e9.2.1771421215725;\n Wed, 18 Feb 2026 05:26:55 -0800 (PST)","by 2002:a05:600c:5295:b0:483:9139:4c29 with SMTP id\n 5b1f17b1804b1-48398a48450mr31689335e9.2.1771421215201;\n Wed, 18 Feb 2026 05:26:55 -0800 (PST)"],"From":"Hanna Czenczek <hreitz@redhat.com>","To":"qemu-block@nongnu.org","Cc":"qemu-devel@nongnu.org, Hanna Czenczek <hreitz@redhat.com>,\n Kevin Wolf <kwolf@redhat.com>, Brian Song <hibriansong@gmail.com>","Subject":"[PATCH v4 05/24] fuse: Change setup_... to mount_fuse_export()","Date":"Wed, 18 Feb 2026 14:26:14 +0100","Message-ID":"<20260218132633.29748-6-hreitz@redhat.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260218132633.29748-1-hreitz@redhat.com>","References":"<20260218132633.29748-1-hreitz@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=170.10.129.124; envelope-from=hreitz@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-20","X-Spam_score":"-2.1","X-Spam_bar":"--","X-Spam_report":"(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.043,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"There is no clear separation between what should go into\nsetup_fuse_export() and what should stay in fuse_export_create().\n\nMake it clear that setup_fuse_export() is for mounting only.  Rename it,\nand move everything that has nothing to do with mounting up into\nfuse_export_create().\n\nReviewed-by: Stefan Hajnoczi <stefanha@redhat.com>\nSigned-off-by: Hanna Czenczek <hreitz@redhat.com>\n---\n block/export/fuse.c | 49 ++++++++++++++++++++-------------------------\n 1 file changed, 22 insertions(+), 27 deletions(-)","diff":"diff --git a/block/export/fuse.c b/block/export/fuse.c\nindex a56f645c05..00bb2ffee4 100644\n--- a/block/export/fuse.c\n+++ b/block/export/fuse.c\n@@ -72,8 +72,7 @@ static void fuse_export_delete(BlockExport *exp);\n \n static void init_exports_table(void);\n \n-static int setup_fuse_export(FuseExport *exp, const char *mountpoint,\n-                             bool allow_other, Error **errp);\n+static int mount_fuse_export(FuseExport *exp, Error **errp);\n static void read_from_fuse_export(void *opaque);\n \n static bool is_regular_file(const char *path, Error **errp);\n@@ -193,23 +192,32 @@ static int fuse_export_create(BlockExport *blk_exp,\n     exp->st_gid = getgid();\n \n     if (args->allow_other == FUSE_EXPORT_ALLOW_OTHER_AUTO) {\n-        /* Ignore errors on our first attempt */\n-        ret = setup_fuse_export(exp, args->mountpoint, true, NULL);\n-        exp->allow_other = ret == 0;\n+        /* Try allow_other == true first, ignore errors */\n+        exp->allow_other = true;\n+        ret = mount_fuse_export(exp, NULL);\n         if (ret < 0) {\n-            ret = setup_fuse_export(exp, args->mountpoint, false, errp);\n+            exp->allow_other = false;\n+            ret = mount_fuse_export(exp, errp);\n         }\n     } else {\n         exp->allow_other = args->allow_other == FUSE_EXPORT_ALLOW_OTHER_ON;\n-        ret = setup_fuse_export(exp, args->mountpoint, exp->allow_other, errp);\n+        ret = mount_fuse_export(exp, errp);\n     }\n     if (ret < 0) {\n         goto fail;\n     }\n \n+    g_hash_table_insert(exports, g_strdup(exp->mountpoint), NULL);\n+\n+    aio_set_fd_handler(exp->common.ctx,\n+                       fuse_session_fd(exp->fuse_session),\n+                       read_from_fuse_export, NULL, NULL, NULL, exp);\n+    exp->fd_handler_set_up = true;\n+\n     return 0;\n \n fail:\n+    fuse_export_shutdown(blk_exp);\n     fuse_export_delete(blk_exp);\n     return ret;\n }\n@@ -227,10 +235,10 @@ static void init_exports_table(void)\n }\n \n /**\n- * Create exp->fuse_session and mount it.\n+ * Create exp->fuse_session and mount it.  Expects exp->mountpoint,\n+ * exp->writable, and exp->allow_other to be set as intended for the mount.\n  */\n-static int setup_fuse_export(FuseExport *exp, const char *mountpoint,\n-                             bool allow_other, Error **errp)\n+static int mount_fuse_export(FuseExport *exp, Error **errp)\n {\n     const char *fuse_argv[4];\n     char *mount_opts;\n@@ -243,7 +251,7 @@ static int setup_fuse_export(FuseExport *exp, const char *mountpoint,\n      */\n     mount_opts = g_strdup_printf(\"max_read=%zu,default_permissions%s\",\n                                  FUSE_MAX_BOUNCE_BYTES,\n-                                 allow_other ? \",allow_other\" : \"\");\n+                                 exp->allow_other ? \",allow_other\" : \"\");\n \n     fuse_argv[0] = \"\"; /* Dummy program name */\n     fuse_argv[1] = \"-o\";\n@@ -256,30 +264,17 @@ static int setup_fuse_export(FuseExport *exp, const char *mountpoint,\n     g_free(mount_opts);\n     if (!exp->fuse_session) {\n         error_setg(errp, \"Failed to set up FUSE session\");\n-        ret = -EIO;\n-        goto fail;\n+        return -EIO;\n     }\n \n-    ret = fuse_session_mount(exp->fuse_session, mountpoint);\n+    ret = fuse_session_mount(exp->fuse_session, exp->mountpoint);\n     if (ret < 0) {\n         error_setg(errp, \"Failed to mount FUSE session to export\");\n-        ret = -EIO;\n-        goto fail;\n+        return -EIO;\n     }\n     exp->mounted = true;\n \n-    g_hash_table_insert(exports, g_strdup(mountpoint), NULL);\n-\n-    aio_set_fd_handler(exp->common.ctx,\n-                       fuse_session_fd(exp->fuse_session),\n-                       read_from_fuse_export, NULL, NULL, NULL, exp);\n-    exp->fd_handler_set_up = true;\n-\n     return 0;\n-\n-fail:\n-    fuse_export_shutdown(&exp->common);\n-    return ret;\n }\n \n /**\n","prefixes":["v4","05/24"]}