fuse: Allow exporting BDSs via FUSE
commit0c9b70d5900a5108e899edfdd6f3790f8cb6bdc2
authorMax Reitz <mreitz@redhat.com>
Tue, 27 Oct 2020 19:05:42 +0000 (27 20:05 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 11 Dec 2020 16:52:39 +0000 (11 17:52 +0100)
treeed23a7492b93435b04325b4cd1227e6d213b066c
parenta484a7195761476dcf43b40437f4d5b8b32d9f2c
fuse: Allow exporting BDSs via FUSE

block-export-add type=fuse allows mounting block graph nodes via FUSE on
some existing regular file.  That file should then appears like a raw
disk image, and accesses to it result in accesses to the exported BDS.

Right now, we only implement the necessary block export functions to set
it up and shut it down.  We do not implement any access functions, so
accessing the mount point only results in errors.  This will be
addressed by a followup patch.

We keep a hash table of exported mount points, because we want to be
able to detect when users try to use a mount point twice.  This is
because we invoke stat() to check whether the given mount point is a
regular file, but if that file is served by ourselves (because it is
already used as a mount point), then this stat() would have to be served
by ourselves, too, which is impossible to do while we (as the caller)
are waiting for it to settle.  Therefore, keep track of mount point
paths to at least catch the most obvious instances of that problem.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20201027190600.192171-3-mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
MAINTAINERS
block.c
block/export/export.c
block/export/fuse.c [new file with mode: 0644]
block/export/meson.build
include/block/fuse.h [new file with mode: 0644]
qapi/block-export.json