The `CONFIGURE_MEM_SLOTS` feature is specified by vhost, not by virtio.
Check the vhost flags for it being set.

I noticed this while testing a new vhost implementation that doesn't yet
support configuring memory slots and retested with dpdk's block example
as well.

Signed-off-by: Dylan Reid <dgr...@dylanreid.com>
---
 hw/virtio/vhost-user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 2fdd5daf74..faa0e133f2 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -1860,7 +1860,7 @@ static int vhost_user_backend_init(struct vhost_dev *dev, 
void *opaque)
         }
 
         /* get max memory regions if backend supports configurable RAM slots */
-        if (!virtio_has_feature(dev->protocol_features,
+        if (!virtio_has_feature(features,
                                 VHOST_USER_PROTOCOL_F_CONFIGURE_MEM_SLOTS)) {
             u->user->memory_slots = VHOST_MEMORY_BASELINE_NREGIONS;
         } else {
-- 
2.25.1


Reply via email to