[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export |
Date: |
Tue, 26 Apr 2022 19:03:10 +0200 |
Am 06.04.2022 um 09:59 hat Xie Yongji geschrieben:
> 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 <xieyongji@bytedance.com>
The request handling code is almos the same as for the vhost-user-blk
export. I wonder if we could share this code instead of copying.
The main difference seems to be that you chose not to support discard
and write_zeroes yet. I'm curious if there is a reason why the
vhost-user-blk code wouldn't work for vdpa there?
> + features = vduse_get_virtio_features() |
> + (1ULL << VIRTIO_BLK_F_SIZE_MAX) |
> + (1ULL << VIRTIO_BLK_F_SEG_MAX) |
> + (1ULL << VIRTIO_BLK_F_TOPOLOGY) |
> + (1ULL << VIRTIO_BLK_F_BLK_SIZE);
> +
> + if (num_queues > 1) {
> + features |= 1ULL << VIRTIO_BLK_F_MQ;
> + }
> + if (!vblk_exp->writable) {
> + features |= 1ULL << VIRTIO_BLK_F_RO;
> + }
VIRTIO_BLK_F_FLUSH seems to be missing even though the flush command is
implemented.
(This is not a full review yet, just two or three things I noticed while
having a quick look.)
Kevin
[PATCH v4 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library, Xie Yongji, 2022/04/06
[PATCH v4 5/6] vduse-blk: Add vduse-blk resize support, Xie Yongji, 2022/04/06
[PATCH v4 6/6] libvduse: Add support for reconnecting, Xie Yongji, 2022/04/06