> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonz...@redhat.com]
> Sent: Thursday, October 19, 2017 7:44 PM
> To: Liu, Changpeng <changpeng....@intel.com>; qemu-devel@nongnu.org
> Cc: stefa...@gmail.com; m...@redhat.com; marcandre.lur...@redhat.com;
> fel...@nutanix.com; Harris, James R <james.r.har...@intel.com>
> Subject: Re: [PATCH v4 4/4] contrib/vhost-user-blk: introduce a vhost-user-blk
> sample application
> 
> On 19/10/2017 07:24, Changpeng Liu wrote:
> >
> > +}
> > +
> > +static void
> > +vub_flush(VubReq *req)
> > +{
> > +    VubDev *vdev_blk = req->vdev_blk;
> > +
> > +    if (vdev_blk->blk_fd) {
> > +        fsync(vdev_blk->blk_fd);
> > +    }
> > +}
> > +
> 
> No need to check the file descriptor---vub_readv and vub_writev aren't
> checking it either.  Also please use fdatasync instead of fsync.
Ok.
> 
> > +static uint64_t
> > +vub_get_features(VuDev *dev)
> > +{
> > +    return 1ull << VIRTIO_BLK_F_SIZE_MAX |
> > +           1ull << VIRTIO_BLK_F_SEG_MAX |
> > +           1ull << VIRTIO_BLK_F_TOPOLOGY |
> > +           1ull << VIRTIO_BLK_F_BLK_SIZE |
> > +           1ull << VIRTIO_F_VERSION_1 |
> > +           1ull << VHOST_USER_F_PROTOCOL_FEATURES;
> > +}
> 
> VIRTIO_BLK_F_FLUSH is missing.
Yes, will add.
> 
> Thanks,
> 
> Paolo

Reply via email to