vmd(8): introduce multi-process model for virtio devices.
authordv <dv@openbsd.org>
Thu, 27 Apr 2023 22:47:27 +0000 (22:47 +0000)
committerdv <dv@openbsd.org>
Thu, 27 Apr 2023 22:47:27 +0000 (22:47 +0000)
commit3481ecdf8ae5fe371caac941fc1b4901598312ae
treec2ef4ccb4e86c97cf18aef7ac1fea027fe67f0ef
parentcd0fb86465baa789b558a83931c8c0278fd1ec3f
vmd(8): introduce multi-process model for virtio devices.

Isolate virtio network and block device emulation in dedicated
processes, forked and exec'd from the vm process. This allows for
tightening pledge promises to just "stdio".

Communication between the vcpu's and these devices now occurs via
imsg channels, which adds the benefit of not always blocking the
vcpu thread while emulating the device.

With this commit, it's possible that vmd is the first open source
hypervisor that *defaults* to a multi-process device emulation
model without requiring any additional configuration from the
operator.

Testing help from phessler@ and Mischa Peters.

ok mlarkin@
12 files changed:
usr.sbin/vmd/Makefile
usr.sbin/vmd/dhcp.c
usr.sbin/vmd/vioblk.c [new file with mode: 0644]
usr.sbin/vmd/vionet.c [new file with mode: 0644]
usr.sbin/vmd/vioqcow2.c
usr.sbin/vmd/vioraw.c
usr.sbin/vmd/virtio.c
usr.sbin/vmd/virtio.h
usr.sbin/vmd/vm.c
usr.sbin/vmd/vmd.c
usr.sbin/vmd/vmd.h
usr.sbin/vmd/vmm.c