On Mon, Mar 21, 2022 at 9:25 PM Eric Blake <ebl...@redhat.com> wrote: > > On Mon, Mar 21, 2022 at 03:14:37PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new command-line syntax is: > > > > $ qemu-storage-daemon \ > > --blockdev file,node-name=drive0,filename=test.img \ > > --export vduse-blk,node-name=drive0,id=vduse-export0,writable=on > > > > After the qemu-storage-daemon started, we need to use > > the "vdpa" command to attach the device to vDPA bus: > > > > $ vdpa dev add name vduse-export0 mgmtdev vduse > > > > Also the device must be removed via the "vdpa" command > > before we stop the qemu-storage-daemon. > > > > Signed-off-by: Xie Yongji <xieyon...@bytedance.com> > > --- > > Looking at just the QAPI: > > > +++ b/qapi/block-export.json > > @@ -170,6 +170,22 @@ > > '*allow-other': 'FuseExportAllowOther' }, > > 'if': 'CONFIG_FUSE' } > > > > +## > > +# @BlockExportOptionsVduseBlk: > > +# > > +# A vduse-blk block export. > > +# > > +# @num-queues: the number of virtqueues. Defaults to 1. > > +# @queue-size: the size of virtqueue. Defaults to 128. > > +# @logical-block-size: Logical block size in bytes. Defaults to 512 bytes. > > Any restrictions on this not being allowed to be smaller than 512, or > that it must be a power of 2, or that it has a maximum size? If so, > they should be documented. >
Yes, it must be [512, PAGE_SIZE]. I will document it in v4. > > +# > > +# Since: 7.0 > > This is a new feature, and is too late for 7.0, so this line should > mention 7.1. > Oh, right. I will fix it. > > +## > > +{ 'struct': 'BlockExportOptionsVduseBlk', > > + 'data': { '*num-queues': 'uint16', > > + '*queue-size': 'uint16', > > + '*logical-block-size': 'size'} } > > + > > ## > > # @NbdServerAddOptions: > > # > > @@ -273,6 +289,7 @@ > > # @nbd: NBD export > > # @vhost-user-blk: vhost-user-blk export (since 5.2) > > # @fuse: FUSE export (since: 6.0) > > +# @vduse-blk: vduse-blk export (since 7.0) > > Another spot for 7.1. > Will fix it. Thanks, Yongji