]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyve: increase number of supported consoles to 4
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Wed, 18 Jun 2025 17:59:47 +0000 (19:59 +0200)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Thu, 17 Jul 2025 17:29:11 +0000 (19:29 +0200)
commit3a342f640299df3b350d63880399f481286a87f6
tree908d924a74535b3426755181b91620133dab48b6
parent8b7db74d4a166c9cfbd97918f660096a0f8f38cf
bhyve: increase number of supported consoles to 4

Recent versions of bhyve support 4 com ports instead of just 2. Thus,
allow to use 4 console devices.

Also, there was a bug previously because the condition was
"if (chr->target.port > 2)", but as target.port start
with 0 and "com" ports start with 1, this condition allows com3 to be
used.

As bhyve supports 4 com ports already long enough, and all supported
FreeBSD versions include this capability, do not introduce driver
capability for that.

Add a couple of tests for that:

 - A domain that uses 4 serials, 2 of type 'nmdm'
   and the other 2 of type 'tcp'
 - A domain that uses unsupported port, such as target.port=4 which
   translates into com5.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
12 files changed:
src/bhyve/bhyve_command.c
tests/bhyvexml2argvdata/bhyvexml2argv-4-consoles.args [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-4-consoles.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-4-consoles.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-serial-invalid-port.args [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-serial-invalid-port.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-serial-invalid-port.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/bhyvexml2argv-serial-tcp.xml
tests/bhyvexml2argvtest.c
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-4-consoles.xml [new file with mode: 0644]
tests/bhyvexml2xmloutdata/bhyvexml2xmlout-serial-tcp.xml
tests/bhyvexml2xmltest.c