summary refs log tree commit diff
path: root/release/checks/pkg-tests.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-06-24 13:19:08 +0000
committerAlyssa Ross <hi@alyssa.is>2024-02-23 15:28:00 +0100
commita2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b (patch)
tree04b8afa29751c2480561581e1c4714751c2f5056 /release/checks/pkg-tests.nix
parentbc1bcf6468072c00b3da0b6f23560f5060447705 (diff)
downloadspectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar.gz
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar.bz2
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar.lz
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar.xz
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.tar.zst
spectrum-a2d362cf70ee73d0c0e96f0d86f8cb61b4596a0b.zip
host: allow VMs to be powered off
Before this change, the s6 services for cloud-hypervisor and virtiofsd
were only started when a VM was started, and vm-stop would bring the
service down.  The problem with this was that if a VM powered itself
off, instead of being stopped on the host using vm-stop, the VM would
instantly be restarted by s6.

To fix this, we disentangle keeping cloud-hypervisor running from
keeping the VM running.  cloud-hypervisor will now always be running,
so s6 will never restart it in normal operation, but it won't be
running a VM until it's told to.  Accomplishing this means having
start-vmm (renamed from start-vm to reflect its new purpose) configure
the VM in cloud-hypervisor without booting it, which is only possible
using the API, not the command line.  As a result, start-vm now
depends on miniserde so that it can construct the VM config JSON
object required by the API.

The build of start-vm has been adjusted to accomodate the complexity
stemming from the new dependencies.  Tests are moved into passthru,
because the start-vm used in Spectrum should have panic=abort, but
tests need panic=unwind, and we can't use both in the same Meson
instance without duplicating the non-native dependencies.

We can't use s6-rc dependencies to automatically boot provider VMs in
this setup, so vm-start has been modified to recurse into provider VMs.

lsvm has been updated to check the Cloud Hypervisor API to see whether
a VM is running, rather than just checking to see whether the s6
service is up.

Because cloud-hypervisor is now to be started as early as possible, we
need to make the dependencies of ext-rc-init more precise, so that
cloud-hypervisor does not attempt to start before /dev/kvm or
/dev/net/tun is available.

We're not using Meson's support for Cargo subprojects yet, because it
currently always builds crates with all features enabled.

Signed-off-by: Alyssa Ross <hi@alyssa.is>
Diffstat (limited to 'release/checks/pkg-tests.nix')
-rw-r--r--release/checks/pkg-tests.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/release/checks/pkg-tests.nix b/release/checks/pkg-tests.nix
index f51ba42..7a41e8d 100644
--- a/release/checks/pkg-tests.nix
+++ b/release/checks/pkg-tests.nix
@@ -2,14 +2,14 @@
 # SPDX-FileCopyrightText: 2023 Alyssa Ross <hi@alyssa.is>
 
 import ../../lib/call-package.nix (
-{ callSpectrumPackage, lseek, start-vm, lib }:
+{ callSpectrumPackage, lseek, start-vmm, lib }:
 
 {
   recurseForDerivations = true;
 
   lseek = lib.recurseIntoAttrs lseek.tests;
 
-  start-vm = lib.recurseIntoAttrs start-vm.tests;
+  start-vmm = lib.recurseIntoAttrs start-vmm.tests;
 
   run-spectrum-vm = lib.recurseIntoAttrs
     (callSpectrumPackage ../../scripts/run-spectrum-vm.nix {}).tests;