Finally I think this is good enough to start upstreaming process.
The patch contains virtio-9p bhyve piece and associated 9p server library, lib9p. lib9p is standalone and can be also used to build a TCP-based 9p server.
New bhyve(8) syntax:
-s <slot>,virtio-9p,sharename=/path/to/the/share # creates virtio-9p device called "sharename" in the guest pointing to /path/to/the/share directory.
As for now, virtio-9p doesn't work in capability mode (bhyve has to be built with WITHOUT_CAPSICUM defined).
Thanks to Chris Torek for writing large parts of the lib9p library and to Sean Eric Fagan for his contributions.