Page MenuHomeFreeBSD

bhyve/virtio-scsi: Support multiple backends
ClosedPublic

Authored by rosenfeld_grumpf.hope-2000.org on Oct 20 2025, 5:46 PM.
Tags
None
Referenced Files
F173565988: D53223.id175088.diff
Sat, Sep 26, 9:28 PM
F173548759: D53223.id172278.diff
Sat, Sep 26, 6:53 PM
F173548546: D53223.id.diff
Sat, Sep 26, 6:51 PM
F173547236: D53223.id175088.diff
Sat, Sep 26, 6:38 PM
F173533952: D53223.id175088.diff
Sat, Sep 26, 4:18 PM
F173533638: D53223.diff
Sat, Sep 26, 4:15 PM
F173531010: D53223.id165407.diff
Sat, Sep 26, 3:42 PM
Unknown Object (File)
Thu, Sep 17, 4:01 PM

Details

Summary

In order to support multiple backends for virtio-scsi, we should isolate
the core of virtio-scsi from the backend-specific code. The existing
interface to CTL will become the new "CTL" backend for virtio-scsi.

Care has been taken to keep compatibility with previous configurations:
The first backend linked (CTL) will be the default backend if none is
specified, and it does provide a default configuration if no further
options such as targets are explicitly configured.

This is currently also under review in illumos: https://code.illumos.org/c/illumos-gate/+/4425

If you're curious about what another backend does look like, here's the review for the illumos USCSI(4i) backend for SCSI passthrough: https://code.illumos.org/c/illumos-gate/+/4426

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73441
Build 70324: arc lint + arc unit

Event Timeline

rosenfeld_grumpf.hope-2000.org retitled this revision from bhyve/virtio-scsi: support multiple backends to bhyve/virtio-scsi: Support multiple backends.Feb 19 2026, 7:36 PM
markj added inline comments.
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
173

Same style issue below.

This revision is now accepted and ready to land.Feb 22 2026, 5:24 PM
This revision now requires review to proceed.Mar 12 2026, 8:34 PM
This revision is now accepted and ready to land.Mar 14 2026, 3:05 AM
This revision now requires review to proceed.Mar 14 2026, 11:07 AM
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
145

This will do the wrong thing if nvl == NULL.

176

I guess this should be sc->vss_backend?

usr.sbin/bhyve/pci_virtio_scsi_ctl.c
145

It should never be NULL as the "target" node is always created before this is called. I replaced the NULL check above with an assertion to that effect.

markj added inline comments.
usr.sbin/bhyve/pci_virtio_scsi_ctl.c
150
This revision is now accepted and ready to land.May 26 2026, 1:49 AM
This revision now requires review to proceed.May 26 2026, 7:24 AM
This revision was not accepted when it landed; it landed in state Needs Review.May 26 2026, 4:07 PM
This revision was automatically updated to reflect the committed changes.