Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions nvx-rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ changes only when the module's purpose does.
| [`nvx::exec`](#nvxexec) | The execution engine: the streams, credit, and outcome of an execution's two sides, without I/O, for any framing |
| [`nvx::host::runtime`](#nvxhostruntime) | `Runtime`: what every launch shares, the runtime's files and their identity, the hypervisor and its probe, and the launch options |
| [`nvx::host::vm`](#nvxhostvm) | The directory of a VM, private to the current user, with the fixed names of the files and endpoints of its launches |
| [`nvx::host::config`](#nvxhostconfig) | `VmConfig`: a VM's processors, memory, root, view, network, export, boot console, and cold-boot settings as one value, checked without reading the host |
| [`nvx::host::config`](#nvxhostconfig) | `VmConfig`, a VM's configuration as one value, and `CaptureConfig`, what a capture adds and the identity of its snapshots, checked without reading the host |
| [`nvx::host::artifacts`](#nvxhostartifacts) | Locating the OpenVMM executable and the guest artifacts that a VM runs, and their runtime identity |
| [`nvx::host::launch`](#nvxhostlaunch) | `LaunchSpec` and `VmmLaunch`: the OpenVMM command line of a managed microVM, its checks, and the inputs that it shares with an adapter's launch |
| [`nvx::host::network`](#nvxhostnetwork) | The one lowering of a network posture into OpenVMM options, for the CLI and external orchestrators |
Expand Down Expand Up @@ -483,9 +483,46 @@ path and checks no support of the host. It fails with an `nvx::Error` of kind
root without an image or a scratch path, with a bound of an EROFS image or of 0,
or with a RAM upper's cap outside 1 to 90 percent; a hostname that an activation
record refuses; or an export that `ExportPlan::check` refuses for the guest
targets that the root reserves. The network's policy and the boot's command line
are checked where they are lowered, with the guest's address and NVX's own
tokens.
targets that the root reserves. Last, it checks a boot's capture with
`CaptureConfig::check`, below, and fails with its error. The network's policy
and the boot's command line are checked where they are lowered, with the
guest's address and NVX's own tokens.

A `Boot` may also hold a `CaptureConfig`, what a capture of the VM adds to the
VM's configuration, which keeps the rest, such as the NIC, the console, and the
export: a `DiskCapture`, so far only `Fresh`, the `BlockGeometry`, length and
block sizes, of the placeholder of the image and of the dormant scratch that a
fresh capture of a blockless VM attaches, which each restore replaces with its
own; its processors and its memory in MiB, each a `Capacity`, what the VM boots
with and what a restore may grow it to; and the caller's `Invariants`, at most
64 settings that NVX keeps without interpreting them, each named by 1 to 64
lowercase ASCII letters, digits, `.`, `-`, and `_` from a letter, with a value
of at most 256 printable ASCII characters. `Invariants` and `BlockGeometry`
belong here, and `nvx::host::template` re-exports them where they were.

`CaptureConfig::check` checks a capture without reading the host. It fails with
an `nvx::Error` of kind `Unsupported` for processors at boot or a capacity other
than 1, 2, 4, or 8, more processors at boot than the capacity, no memory at
boot, a memory capacity below it or not a multiple of 128 MiB, or a disk whose
geometry the template's manifest would refuse: a logical block size that is not
a power of two of at least 512 bytes, a physical one that is not a power of two
of at least the logical one, or a length that is not a nonzero multiple of the
logical one.

`CaptureConfig::identity` returns the `CaptureIdentity` that names the
snapshots of a capture of a VM of a `VmConfig` on a `Runtime`: the SHA-256
digest, after the domain `nvx capture` and a NUL, of a fixed encoding of what
tells captures apart, which displays and serializes as 64 lowercase hexadecimal
digits. It identifies the captures that NVX supports, fresh captures of a
blockless VM, from the values alone: it reads nothing on the host and refuses
no configuration, which creating the capture checks. It digests the runtime's
identity, the versions of this crate's contracts, the hypervisor, and the
requested CPU profile; the capture's disks, processors, memory, and invariants;
and the VM's NIC's address, `DEFAULT_GUEST_NETWORK` when the configuration
names none, its console attachment, whether it exports host paths, and its
boot's command line. No path, launch option, view, network policy, or anything
of the VM's root is part of it, nor the VM's own processors and memory, for
which the capture's count.

### `nvx::host::artifacts`

Expand Down
30 changes: 30 additions & 0 deletions nvx-rs/public-api/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1750,12 +1750,42 @@ fn nvx::host::artifacts::openvmm_executable
mod nvx::host::cli (hidden)
fn nvx::host::cli::main (hidden)
mod nvx::host::config
struct nvx::host::config::BlockGeometry
field nvx::host::config::BlockGeometry::length
field nvx::host::config::BlockGeometry::logical_block_size
field nvx::host::config::BlockGeometry::physical_block_size
struct nvx::host::config::Boot
field nvx::host::config::Boot::capture
field nvx::host::config::Boot::command_line
struct nvx::host::config::Capacity
field nvx::host::config::Capacity::boot
field nvx::host::config::Capacity::capacity
struct nvx::host::config::CaptureConfig
method nvx::host::config::CaptureConfig::check
field nvx::host::config::CaptureConfig::disks
method nvx::host::config::CaptureConfig::identity
field nvx::host::config::CaptureConfig::invariants
field nvx::host::config::CaptureConfig::memory
field nvx::host::config::CaptureConfig::processors
struct nvx::host::config::CaptureIdentity
enum nvx::host::config::ConsoleAttachment
variant nvx::host::config::ConsoleAttachment::Disconnected
variant nvx::host::config::ConsoleAttachment::Listener
const nvx::host::config::DEFAULT_GUEST_NETWORK
enum nvx::host::config::DiskCapture
variant nvx::host::config::DiskCapture::Fresh
field nvx::host::config::DiskCapture::Fresh::image
field nvx::host::config::DiskCapture::Fresh::scratch
struct nvx::host::config::Invariants
const nvx::host::config::Invariants::MAX_NAME_LEN
const nvx::host::config::Invariants::MAX_SETTINGS
const nvx::host::config::Invariants::MAX_VALUE_LEN
method nvx::host::config::Invariants::get
method nvx::host::config::Invariants::is_empty
method nvx::host::config::Invariants::iter
method nvx::host::config::Invariants::len
method nvx::host::config::Invariants::new
method nvx::host::config::Invariants::with
struct nvx::host::config::LayeredRoot
field nvx::host::config::LayeredRoot::format
field nvx::host::config::LayeredRoot::gpt_first_partition_bound
Expand Down
30 changes: 30 additions & 0 deletions nvx-rs/public-api/windows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,42 @@ fn nvx::host::artifacts::openvmm_executable
mod nvx::host::cli (hidden)
fn nvx::host::cli::main (hidden)
mod nvx::host::config
struct nvx::host::config::BlockGeometry
field nvx::host::config::BlockGeometry::length
field nvx::host::config::BlockGeometry::logical_block_size
field nvx::host::config::BlockGeometry::physical_block_size
struct nvx::host::config::Boot
field nvx::host::config::Boot::capture
field nvx::host::config::Boot::command_line
struct nvx::host::config::Capacity
field nvx::host::config::Capacity::boot
field nvx::host::config::Capacity::capacity
struct nvx::host::config::CaptureConfig
method nvx::host::config::CaptureConfig::check
field nvx::host::config::CaptureConfig::disks
method nvx::host::config::CaptureConfig::identity
field nvx::host::config::CaptureConfig::invariants
field nvx::host::config::CaptureConfig::memory
field nvx::host::config::CaptureConfig::processors
struct nvx::host::config::CaptureIdentity
enum nvx::host::config::ConsoleAttachment
variant nvx::host::config::ConsoleAttachment::Disconnected
variant nvx::host::config::ConsoleAttachment::Listener
const nvx::host::config::DEFAULT_GUEST_NETWORK
enum nvx::host::config::DiskCapture
variant nvx::host::config::DiskCapture::Fresh
field nvx::host::config::DiskCapture::Fresh::image
field nvx::host::config::DiskCapture::Fresh::scratch
struct nvx::host::config::Invariants
const nvx::host::config::Invariants::MAX_NAME_LEN
const nvx::host::config::Invariants::MAX_SETTINGS
const nvx::host::config::Invariants::MAX_VALUE_LEN
method nvx::host::config::Invariants::get
method nvx::host::config::Invariants::is_empty
method nvx::host::config::Invariants::iter
method nvx::host::config::Invariants::len
method nvx::host::config::Invariants::new
method nvx::host::config::Invariants::with
struct nvx::host::config::LayeredRoot
field nvx::host::config::LayeredRoot::format
field nvx::host::config::LayeredRoot::gpt_first_partition_bound
Expand Down
Loading
Loading