git: 5379c4627782 - main - bhyve/virtio: check negotiated_caps for indirect descriptor support

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Thu, 05 Feb 2026 18:49:48 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=5379c4627782ebb2619f95a5784361c88472c8b5

commit 5379c4627782ebb2619f95a5784361c88472c8b5
Author:     Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org>
AuthorDate: 2026-02-05 18:48:10 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2026-02-05 18:49:09 +0000

    bhyve/virtio: check negotiated_caps for indirect descriptor support
    
    vq_getchain() erroneously checked vc_hv_caps for indirect descriptor
    support when it encountered an indirect descriptor. vc_hv_caps is used
    in feature negotiation to advertise what features our device emulation
    supports, but we should really check what features we have negotiated
    with the driver.
    
    Reviewed by: corvink
    Differential Revision: https://reviews.freebsd.org/D53465
---
 usr.sbin/bhyve/virtio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/bhyve/virtio.c b/usr.sbin/bhyve/virtio.c
index 304156bf7416..a5ccbb9983a0 100644
--- a/usr.sbin/bhyve/virtio.c
+++ b/usr.sbin/bhyve/virtio.c
@@ -331,7 +331,7 @@ vq_getchain(struct vqueue_info *vq, struct iovec *iov, int niov,
 		if ((vdir->flags & VRING_DESC_F_INDIRECT) == 0) {
 			_vq_record(i, vdir, ctx, iov, niov, &req);
 			i++;
-		} else if ((vs->vs_vc->vc_hv_caps &
+		} else if ((vs->vs_negotiated_caps &
 		    VIRTIO_RING_F_INDIRECT_DESC) == 0) {
 			EPRINTLN(
 			    "%s: descriptor has forbidden INDIRECT flag, "