aboutsummaryrefslogtreecommitdiff
path: root/tools/virtiofsd/helper.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2020-11-02 17:18:57 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-11-02 19:22:51 +0000
commit9d82f6a3e68c2986633ad11687da2193e9acb0cb (patch)
tree463f082d36d7351cef563d740a0e1a9a47f52410 /tools/virtiofsd/helper.c
parentd672fce6baa0a02dfa64d717fb072c06e301d695 (diff)
downloadqemu-9d82f6a3e68c2986633ad11687da2193e9acb0cb.zip
qemu-9d82f6a3e68c2986633ad11687da2193e9acb0cb.tar.gz
qemu-9d82f6a3e68c2986633ad11687da2193e9acb0cb.tar.bz2
virtiofsd: Announce sub-mount points
Whenever we encounter a directory with an st_dev or mount ID that differs from that of its parent, we set the FUSE_ATTR_SUBMOUNT flag so the guest can create a submount for it. We only need to do so in lo_do_lookup(). The following functions return a fuse_attr object: - lo_create(), though fuse_reply_create(): Calls lo_do_lookup(). - lo_lookup(), though fuse_reply_entry(): Calls lo_do_lookup(). - lo_mknod_symlink(), through fuse_reply_entry(): Calls lo_do_lookup(). - lo_link(), through fuse_reply_entry(): Creating a link cannot create a submount, so there is no need to check for it. - lo_getattr(), through fuse_reply_attr(): Announcing submounts when the node is first detected (at lookup) is sufficient. We do not need to return the submount attribute later. - lo_do_readdir(), through fuse_add_direntry_plus(): Calls lo_do_lookup(). Make announcing submounts optional, so submounts are only announced to the guest with the announce_submounts option. Some users may prefer the current behavior, so that the guest learns nothing about the host mount structure. (announce_submounts is force-disabled when the guest does not present the FUSE_SUBMOUNTS capability, or when there is no statx().) Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20201102161859.156603-6-mreitz@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'tools/virtiofsd/helper.c')
-rw-r--r--tools/virtiofsd/helper.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/virtiofsd/helper.c b/tools/virtiofsd/helper.c
index ae1b22e..75ac48d 100644
--- a/tools/virtiofsd/helper.c
+++ b/tools/virtiofsd/helper.c
@@ -190,6 +190,7 @@ void fuse_cmdline_help(void)
" retain/discard O_DIRECT flags passed down\n"
" to virtiofsd from guest applications.\n"
" default: no_allow_direct_io\n"
+ " -o announce_submounts Announce sub-mount points to the guest\n"
);
}