Page MenuHomeFreeBSD

Add virtio-console support to bhyve
ClosedPublic

Authored by jceel on Jul 11 2016, 1:19 PM.

Details

Summary

Adds virtio-console device support to bhyve, allowing to create bidirectional character streams between host and guest.

Syntax:
-s <slotnum>,virtio-console,port1=/path/to/port1.sock,port2=/path/to/port2.sock,...

Maximum of 16 ports per device can be created. Every port is named and corresponds to an Unix domain socket created by bhyve. bhyve accepts at most one unix domain socket connection per port at a time.

Limitations:

  • due to lack of destructors of in bhyve, sockets on the filesystem must be cleaned up manually after bhyve exits
  • there's no way to use "console port" feature, nor the console port resize as of yet
  • emergency write is advertised, but no-op as of yet
Test Plan

Start FreeBSD guest in bhyve with -s 9,virtio-console,testport=/tmp/testport.sock. Type kldload virtio_console in the guest, then cu -l /dev/ttyV0.0 in the guest and socat - /tmp/testport.sock in the host.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jceel updated this revision to Diff 18284.Jul 11 2016, 1:19 PM
jceel retitled this revision from to Add virtio-console support to bhyve.
jceel updated this object.
jceel edited the test plan for this revision. (Show Details)
jceel added reviewers: grehan, trasz.
jceel set the repository for this revision to rS FreeBSD src repository.
jceel added a subscriber: freebsd-virtualization-list.
jceel updated this revision to Diff 20401.Sep 17 2016, 1:31 PM

Cast basename() argument to char *.

This revision was automatically updated to reflect the committed changes.