All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Xie Yongji <xieyongji@bytedance.com>
Cc: qemu-block@nongnu.org, mst@redhat.com, eblake@redhat.com,
	jasowang@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com,
	mlureau@redhat.com, stefanha@redhat.com, jsnow@redhat.com,
	sgarzare@redhat.com
Subject: Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export
Date: Tue, 26 Apr 2022 19:03:10 +0200	[thread overview]
Message-ID: <Ymglzs0iKKUFiFNW@redhat.com> (raw)
In-Reply-To: <20220406075921.105-5-xieyongji@bytedance.com>

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



  reply	other threads:[~2022-04-26 17:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  7:59 [PATCH v4 0/6] Support exporting BDSs via VDUSE Xie Yongji
2022-04-06  7:59 ` [PATCH v4 1/6] block: Support passing NULL ops to blk_set_dev_ops() Xie Yongji
2022-04-06  7:59 ` [PATCH v4 2/6] linux-headers: Add vduse.h Xie Yongji
2022-04-06  7:59 ` [PATCH v4 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library Xie Yongji
2022-04-06  7:59 ` [PATCH v4 4/6] vduse-blk: implements vduse-blk export Xie Yongji
2022-04-26 17:03   ` Kevin Wolf [this message]
2022-04-27  3:11     ` Yongji Xie
2022-04-27 13:22       ` Kevin Wolf
2022-04-27 13:42         ` Yongji Xie
2022-04-06  7:59 ` [PATCH v4 5/6] vduse-blk: Add vduse-blk resize support Xie Yongji
2022-04-06  7:59 ` [PATCH v4 6/6] libvduse: Add support for reconnecting Xie Yongji

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Ymglzs0iKKUFiFNW@redhat.com \
    --to=kwolf@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mlureau@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=xieyongji@bytedance.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.