qemu-devel
[Top][All Lists]
Advanced

[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: Daniil Tatianin
Subject: Re: [PATCH v1 3/5] vhost-user-blk: make it possible to disable write-zeroes/discard
Date: Wed, 24 Aug 2022 23:24:55 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

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)?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]