]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyve: add virtio-console support
authorRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 28 Mar 2026 13:36:21 +0000 (14:36 +0100)
committerRoman Bogorodskiy <bogorodskiy@gmail.com>
Sat, 2 May 2026 08:31:38 +0000 (10:31 +0200)
commit150b8fe6eea9ff0a6e6e4692a9a4e2cf8eea91ac
treead1d9d78609292bffd940e31759ff32778cd961a
parent2971113792bfb4c7150ce85d9f5403e8d8988bc3
bhyve: add virtio-console support

Bhyve supports virtio-console devices using the following syntax:

 -s 2:0,virtio-console,org.qemu.guest_agent.0=/path/to/unix/socket,other.port=/other/socket,...

There are two details about that to consider.

The first one is that only up to 16 ports per console is supported. This
is different from the default (31), so update the code to manually add
the virtio-serial controllers with 16 ports. For the existing
controllers, make sure to set max ports to 16 or error out if ports
count greater than 16 was specified.

The second one is that bhyve does not clean up UNIX sockets for these
devices. So update virBhyveProcessStop() to remove leftover sockets.

Not adding capabilities probing as the virtio-console device is
available on all supported FreeBSD versions and on all supported arches.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
29 files changed:
src/bhyve/bhyve_command.c
src/bhyve/bhyve_device.c
src/bhyve/bhyve_domain.c
src/bhyve/bhyve_process.c
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-2-virtio-console-mixed-addr.args [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-2-virtio-console-mixed-addr.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-2-virtio-console-mixed-addr.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-addr.args [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-addr.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-addr.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-controllers.args [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-controllers.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-controllers.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-invalid-name.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-invalid-path.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-multiple-controllers.args [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-multiple-controllers.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-multiple-controllers.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console-too-many-ports.xml [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console.args [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console.ldargs [new file with mode: 0644]
tests/bhyvexml2argvdata/x86_64/bhyvexml2argv-virtio-console.xml [new file with mode: 0644]
tests/bhyvexml2argvtest.c
tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-2-virtio-console-mixed-addr.xml [new file with mode: 0644]
tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-virtio-console-addr.xml [new file with mode: 0644]
tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-virtio-console-controllers.xml [new file with mode: 0644]
tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-virtio-console-multiple-controllers.xml [new file with mode: 0644]
tests/bhyvexml2xmloutdata/x86_64/bhyvexml2xmlout-virtio-console.xml [new file with mode: 0644]
tests/bhyvexml2xmltest.c