Page MenuHomeFreeBSD

Add bhyve uart raw tcp backend
Needs ReviewPublic

Authored by aokblast on Wed, May 8, 12:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 20, 2:54 PM
Unknown Object (File)
Sat, May 11, 4:53 PM
Unknown Object (File)
Thu, May 9, 2:51 PM
Unknown Object (File)
Thu, May 9, 2:51 PM
Unknown Object (File)
Thu, May 9, 4:45 AM

Details

Reviewers
lwhsu
corvink
markj
bz
Group Reviewers
bhyve
Summary

This is a updated patch from this old patch according to the modification from markj on uart part of bhyve.

This patch add raw tcp connection ability on bhyve and has been tested on my own machine.

An example about this is as following:

bhyve -c 2 -m 4G -w -H \
                                       -s 0,hostbridge \
                                       -s 1,virtio-blk,./FreeBSD-14.0-STABLE-amd64-20240118-cef433d3fb38-266364.raw \
                                       -s 30,xhci,tablet \
                                       -s 31,lpc -l com1,tcp=127.0.0.1:8085 \
                                       -l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
                                        uefivm

Then we can use nc by:

netcat 127.0.0.1 8085

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 57916
Build 54804: arc lint + arc unit

Event Timeline

aokblast added reviewers: lwhsu, corvink, markj.
aokblast retitled this revision from Add bhyve uart tcp backend to Add bhyve uart raw tcp backend.
usr.sbin/bhyve/uart_backend.c
339

Shouldn't we lock sc->mtx here?

usr.sbin/bhyve/bhyve.8
1134

tcp= ?

bz requested changes to this revision.Wed, May 15, 4:54 PM
bz added a subscriber: bz.
bz added inline comments.
usr.sbin/bhyve/uart_backend.c
303

This won't take an IPv6 address?

This revision now requires changes to proceed.Wed, May 15, 4:54 PM
usr.sbin/bhyve/uart_backend.c
335

It's better to use C-style comments.

343

I think we should close the descriptor here to avoid leakage.

  • Add bhyve uart tcp backend
  • Add manual page

I fix the previous error previously mentioned, and because uart_tcp_disconnect is a helper function and it parent has already lock it. I add comment to let everyone use this function in the future know this.

  • Add bhyve uart tcp backend
  • Add manual page