From d83ffd7d7d7f81451f58e3ad8c054bb628f43265 Mon Sep 17 00:00:00 2001 From: Muminul Islam Date: Wed, 3 Jun 2026 17:56:24 -0700 Subject: [PATCH] docs: document hypervisor auto-detection in testing guide Describe --hypervisor as an optional override that defaults to auto-detection from the host device node (/dev/mshv or /dev/kvm) for both the build and tests commands and the shared test-script arguments. Assisted-by: Claude:Opus-4.8 Signed-off-by: Muminul Islam --- docs/testing.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/testing.md b/docs/testing.md index 0029cf01d..f06a96d6e 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -78,7 +78,7 @@ scripts/dev_cli.sh build [--debug|--release] [--libc musl|gnu] \ | `--debug` | yes | Build debug binaries. | | `--release` | | Build release binaries. | | `--libc` | `gnu` | C library to link against (`musl`/`gnu`).| -| `--hypervisor` | `kvm` | Hypervisor backend (`kvm`/`mshv`). | +| `--hypervisor` | auto | Hypervisor backend (`kvm`/`mshv`). Auto-detected from the host device node when omitted. | | `--features` | | Additional cargo features. | | `--volumes` | | Extra host volumes (`/a:/a#/b:/b`). | | `--runtime` | `docker`| Container runtime (`docker`/`podman`). | @@ -112,7 +112,7 @@ scripts/dev_cli.sh tests [] [--libc musl|gnu] \ | Flag | Default | Description | |----------------|---------|------------------------------------------| | `--libc` | `gnu` | C library to link against (`musl`/`gnu`).| -| `--hypervisor` | `kvm` | Hypervisor backend (`kvm`/`mshv`). | +| `--hypervisor` | auto | Hypervisor backend (`kvm`/`mshv`). Auto-detected from the host device node when omitted. | | `--volumes` | | Extra host volumes (`/a:/a#/b:/b`). | ### Argument passthrough @@ -134,7 +134,7 @@ The test scripts accept the following common arguments via | Argument | Description | |-----------------------|----------------------------------------------| -| `--hypervisor kvm\|mshv` | Select hypervisor (also passed by dev_cli.sh). | +| `--hypervisor kvm\|mshv` | Override the hypervisor (auto-detected from the host device node when omitted; also passed by dev_cli.sh). | | `--test-filter `| Run only tests matching the filter. | | `--test-exclude `| Exclude tests matching the pattern. | | `--build-guest-kernel`| Build the guest kernel from source instead of downloading a prebuilt binary. | @@ -208,6 +208,10 @@ When the hypervisor is `mshv`, the feature flag `--features mshv` is passed to cargo. On x86_64 with KVM, the `tdx` feature is additionally enabled if needed (MSHV does not support TDX). +The hypervisor backend is auto-detected from the host device node: +`/dev/mshv` selects MSHV and `/dev/kvm` selects KVM. Pass +`--hypervisor kvm|mshv` to override the detection explicitly. + ## Integration tests All integration test containers run with `--privileged` and full @@ -341,7 +345,7 @@ guest images and a prebuilt kernel. ### Confidential VMs ```shell -scripts/dev_cli.sh tests --integration-cvm [--hypervisor mshv] +scripts/dev_cli.sh tests --integration-cvm ``` Runs `scripts/run_integration_tests_cvm.sh`. Builds with `--features