From 88c0d77e138d7f5fac2620cca84601424d7019e5 Mon Sep 17 00:00:00 2001 From: Hans Rosenfeld Date: Tue, 31 Mar 2026 19:03:16 +0200 Subject: [PATCH] brand/bhyve: Add comN attribute This attribute allows configuring additional LPC COM ports besides the console port at COM1. --- src/brand/bhyve/boot.py | 6 ++++++ src/man/bhyve.7 | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/brand/bhyve/boot.py b/src/brand/bhyve/boot.py index 421f470de..1f2097e65 100755 --- a/src/brand/bhyve/boot.py +++ b/src/brand/bhyve/boot.py @@ -450,6 +450,12 @@ def apply_bootnext(v): args.extend(['-s', '{0},lpc'.format(LPC_SLOT)]) +# LPC Serial Ports + +for i, v in z.build_devlist('com', 4): + if i > 1: + args.extend(['-l', 'com{0},{1}'.format(i, v)]) + # Console args.extend(['-l', 'com1,{0}'.format(opts['console'])]) diff --git a/src/man/bhyve.7 b/src/man/bhyve.7 index 27c73b1ab..2389ccf03 100644 --- a/src/man/bhyve.7 +++ b/src/man/bhyve.7 @@ -225,6 +225,35 @@ If a .Ar URL is provided, then that is passed to the guest system as the source of the full meta-data. +.\" com +.It Ic com Ns Ar N Ar options +.Pp +This parameter configures a LPC COM port, with valid values for +.Ar N +ranging from 2 to 4. +.Pp +The supported +.Ar options +are either +.Cm socket , Ns Ar path , +which places a UNIX domain socket at +.Ar path , +or +.Pa /dev/ttyXX , +which attaches the COM port to a +.Sy tty +device. +The latter format requires a +.Sy device +block to map +.Pa /dev/ttyXX +into the zone. +.Pp +A configuration for +.Ic com Ns Ar 1 +will be silently ignored, the +.Ic console +parameter described below must be used instead. .\" console .It Ic console Ar options .Pp