MFC r349285
VirtIO SCSI: validate seg_max on attach
Until head r349278 (stable/12 r349690), bhyve presented a seg_max
to the guest that was too large. Detect this case and clamp it to
the virtqueue size. Otherwise, we would fail the "too many segments
to enqueue" assertion in virtqueue_enqueue().
I hit this by running a guest with a MAXPHYS of 256 KB.
Reviewed by: bryanv cem
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D20703