diff options
author | Max Reitz <mreitz@redhat.com> | 2020-10-27 20:05:42 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2020-12-11 17:52:39 +0100 |
commit | 0c9b70d5900a5108e899edfdd6f3790f8cb6bdc2 (patch) | |
tree | ed23a7492b93435b04325b4cd1227e6d213b066c /qapi | |
parent | a484a7195761476dcf43b40437f4d5b8b32d9f2c (diff) |
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>
Diffstat (limited to 'qapi')
-rw-r--r-- | qapi/block-export.json | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/qapi/block-export.json b/qapi/block-export.json index 4eeac7842d..430bc69f35 100644 --- a/qapi/block-export.json +++ b/qapi/block-export.json @@ -121,6 +121,21 @@ '*num-queues': 'uint16'} } ## +# @BlockExportOptionsFuse: +# +# Options for exporting a block graph node on some (file) mountpoint +# as a raw image. +# +# @mountpoint: Path on which to export the block device via FUSE. +# This must point to an existing regular file. +# +# Since: 6.0 +## +{ 'struct': 'BlockExportOptionsFuse', + 'data': { 'mountpoint': 'str' }, + 'if': 'defined(CONFIG_FUSE)' } + +## # @NbdServerAddOptions: # # An NBD block export, per legacy nbd-server-add command. @@ -222,11 +237,13 @@ # # @nbd: NBD export # @vhost-user-blk: vhost-user-blk export (since 5.2) +# @fuse: FUSE export (since: 6.0) # # Since: 4.2 ## { 'enum': 'BlockExportType', - 'data': [ 'nbd', 'vhost-user-blk' ] } + 'data': [ 'nbd', 'vhost-user-blk', + { 'name': 'fuse', 'if': 'defined(CONFIG_FUSE)' } ] } ## # @BlockExportOptions: @@ -267,7 +284,9 @@ 'discriminator': 'type', 'data': { 'nbd': 'BlockExportOptionsNbd', - 'vhost-user-blk': 'BlockExportOptionsVhostUserBlk' + 'vhost-user-blk': 'BlockExportOptionsVhostUserBlk', + 'fuse': { 'type': 'BlockExportOptionsFuse', + 'if': 'defined(CONFIG_FUSE)' } } } ## |