= 005 Virtual Machine Monitor
:page-parent: Architecture Decision Records
:page-grand_parent: About Spectrum OS

// SPDX-FileCopyrightText: 2022 Unikie
// SPDX-License-Identifier: GFDL-1.3-no-invariants-or-later OR CC-BY-SA-4.0

== Status

Accepted

== Context

The https://github.com/rust-vmm[rust-vmm] project provides shared components for
building Virtual Machine Monitors (VMMs) in the Rust programming language.
Rust's focus on memory safety makes it a very compelling choice for
Spectrum's VMM.

The extant rust-vmm-based VMMs are https://google.github.io/crosvm/[crosvm]
https://firecracker-microvm.github.io/[Firecracker], and
https://www.cloudhypervisor.org/[Cloud Hypervisor].

Firecracker does not support other virtio-devices than net or block.

In comparision to crosvm, Cloud Hypervisor has a more flexible IPC mechanisms,
better hotplugging support, and a more engaging community as a Linux Foundation
project.  Cloud Hypervisor additionally has more core features - such as
snapshotting, live migration. crosvm supports more devices we will also need.

It will be easier to port devices from crosvm to cloud-hypervisor than to port
core features from cloud-hypervisor to crosvm.

== Decision

Spectrum will use cloud-hypervisor as the primary VMM.

== Consequences

- Some devices need to be ported from crosvm to cloud-hypervisor.

- Spectrum functionality is expected to break and not supported if the
  primary VMM is swapped out.
