HomeFreeBSD

bhyve: Use a non-blocking read in slirp_recv()

Description

bhyve: Use a non-blocking read in slirp_recv()

When using the slirp backend with the e1000 frontend, I otherwise get
hangs in readv(), caused by the e1000 emulation not checking whether
bytes are available before trying to read them. In particular, that
device model expects the recv callback to return 0 if no bytes are
available, and with slirp it would end up blocking forever. The virtio
device model uses the peek_recvlen to check first, so I didn't notice
the problem when implementing the slirp backend.

Make the slirp backend more flexible to accommodate e1000.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D48164

Details

Provenance
markjAuthored on Jan 7 2025, 2:33 PM
Differential Revision
D48164: bhyve: Use a non-blocking read in slirp_recv()
Parents
rG596ee234ef45: ktrace: Make -t t trace struct arrays as well as structs
Branches
Unknown
Tags
Unknown