[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v1 3/5] vhost-user-blk: make it possible to disable write-zer
From: |
Stefan Hajnoczi |
Subject: |
Re: [PATCH v1 3/5] vhost-user-blk: make it possible to disable write-zeroes/discard |
Date: |
Thu, 25 Aug 2022 09:34:01 -0400 |
On Wed, Aug 24, 2022 at 11:24:55PM +0300, Daniil Tatianin wrote:
> On 8/24/22 9:00 PM, Stefan Hajnoczi wrote:
> > On Wed, Aug 24, 2022 at 12:18:35PM +0300, Daniil Tatianin wrote:
> > > diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c
> > > index 9117222456..e89164c358 100644
> > > --- a/hw/block/vhost-user-blk.c
> > > +++ b/hw/block/vhost-user-blk.c
> > > @@ -251,6 +251,8 @@ static uint64_t
> > > vhost_user_blk_get_features(VirtIODevice *vdev,
> > > {
> > > VHostUserBlk *s = VHOST_USER_BLK(vdev);
> > > + features |= s->host_features;
> >
> > I think you can eliminate this if you use vdev->host_features in the
> > qdev properties instead of adding a separate s->host_features field.
> > That will simplify the code.
> Indeed, thanks for spotting that. I wonder why every virtio device
> implementation I've looked at has chosen to add their own host_features
> field (net/blk)?
It's for historical reasons. Over time more common behavior moves into
the core, but not all devices have been refactored to take advantage of
that.
Thanks,
Stefan
signature.asc
Description: PGP signature