On Tue, Sep 29, 2026 at 03:16:23PM +0500, Alexandr Moshkov wrote:
Currently, building with --disable-vhost-user fails to link when other
vhost backends are enabled: vhost.c calls vhost_user_has_protocol_feature(),
but its implementation is not built.
Add a stub returning false to fix the link error.
Should we add Clément's tag?
Reported-by: Clément Chigot <[email protected]>
Fixes tag?
Fixes: 5eb2347867 ("vhost-user: add skip_drain param to
do_vhost_virtqueue_stop")
Is this one, right?
Looking better at that commit, can we avoid to call
vhost_user_has_protocol_feature() at all in do_vhost_virtqueue_stop()
and put an assert in vhost_user_get_vring_base_skip_drain() to check
that the feature is negotiated?
That said, not sure if it should be an assert TBH.
Thanks,
Stefano
Signed-off-by: Alexandr Moshkov <[email protected]>
---
hw/virtio/vhost-user-stub.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/virtio/vhost-user-stub.c b/hw/virtio/vhost-user-stub.c
index 45559788dd..9d2e521788 100644
--- a/hw/virtio/vhost-user-stub.c
+++ b/hw/virtio/vhost-user-stub.c
@@ -4,3 +4,8 @@
void vhost_user_qmp_status(struct vhost_dev *dev, VirtioStatus *status)
{
}
+
+bool vhost_user_has_protocol_feature(struct vhost_dev *dev, uint64_t feature)
+{
+ return false;
+}
--
2.34.1