From 49ea109f91656febe19a14ddc1f533a77f5f3f88 Mon Sep 17 00:00:00 2001 From: Enrique Saurez Date: Sat, 7 Nov 2026 23:59:35 -0800 Subject: [PATCH] host: import retained types from their low-level owners The artifact modules, the snapshot key and PreparedLaunch stay after the slimming, but they named ArtifactIdentity, RuntimeIdentity, MAX_IDENTITY_LEN and Inherited through host::store and host::supervisor, which only re-export them and which later PRs delete. Each import now names the module that owns the type: host::runtime for the identities, and host::platform::inherit for Inherited. The types are the same, so artifact discovery, identity comparison, snapshot keys and prepared launches behave as before, and the public API does not change. The artifact tests, and the snapshot tests' builders, through which the snapshot-key tests build their identities, import the identities from host::runtime too. Copilot-Session: 1b7e900c-27be-4ae2-9d4b-a912e7dac394 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nvx-rs/src/host/artifacts/dir.rs | 2 +- nvx-rs/src/host/artifacts/identity.rs | 2 +- nvx-rs/src/host/artifacts/mod.rs | 2 +- nvx-rs/src/host/artifacts/tests.rs | 2 +- nvx-rs/src/host/sandbox/prepared.rs | 2 +- nvx-rs/src/host/snapshot/key.rs | 2 +- nvx-rs/src/host/snapshot/tests.rs | 3 +-- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/nvx-rs/src/host/artifacts/dir.rs b/nvx-rs/src/host/artifacts/dir.rs index dddab5c11..5654c22ba 100644 --- a/nvx-rs/src/host/artifacts/dir.rs +++ b/nvx-rs/src/host/artifacts/dir.rs @@ -14,7 +14,7 @@ use super::{ REPO_BUILD_DIR, REPO_OPENVMM_DIR, absolute, is_release_dir, openvmm_executable, }; use crate::error::{Error, Result}; -use crate::host::store::{ArtifactIdentity, RuntimeIdentity}; +use crate::host::runtime::{ArtifactIdentity, RuntimeIdentity}; /// The layout of a directory of NVX artifacts. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize)] diff --git a/nvx-rs/src/host/artifacts/identity.rs b/nvx-rs/src/host/artifacts/identity.rs index 393c16d06..6a74f972d 100644 --- a/nvx-rs/src/host/artifacts/identity.rs +++ b/nvx-rs/src/host/artifacts/identity.rs @@ -9,7 +9,7 @@ use serde_json::Value; use super::{MAX_METADATA_LEN, PROVENANCE_FORMAT}; use crate::error::{Error, Result}; -use crate::host::store::ArtifactIdentity; +use crate::host::runtime::ArtifactIdentity; /// Returns the identity of an artifact whose SHA-256 digest is `digest`, if it holds 64 lowercase /// hexadecimal digits, as `nvx.py` writes digests and requires them. diff --git a/nvx-rs/src/host/artifacts/mod.rs b/nvx-rs/src/host/artifacts/mod.rs index 508c2b2d4..224503a25 100644 --- a/nvx-rs/src/host/artifacts/mod.rs +++ b/nvx-rs/src/host/artifacts/mod.rs @@ -40,7 +40,7 @@ use serde_json::Value; use crate::contract; use crate::error::{Error, ErrorCode, Result}; use crate::host::platform; -use crate::host::store::RuntimeIdentity; +use crate::host::runtime::RuntimeIdentity; pub use self::dir::{ArtifactDir, ArtifactPaths, GuestPaths, Layout}; pub use self::guest::Guest; diff --git a/nvx-rs/src/host/artifacts/tests.rs b/nvx-rs/src/host/artifacts/tests.rs index 3e4de6351..65671aa15 100644 --- a/nvx-rs/src/host/artifacts/tests.rs +++ b/nvx-rs/src/host/artifacts/tests.rs @@ -5,7 +5,7 @@ use std::collections::HashMap; use super::*; use crate::ErrorKind; -use crate::host::store::ArtifactIdentity; +use crate::host::runtime::ArtifactIdentity; const COMPATIBLE_MANIFEST: &str = r#"{"openvmm":{"microvm_abi_version":1, "time_abi_version":1,"restore_packet_version":1, diff --git a/nvx-rs/src/host/sandbox/prepared.rs b/nvx-rs/src/host/sandbox/prepared.rs index 9eab23b5f..f32dfa251 100644 --- a/nvx-rs/src/host/sandbox/prepared.rs +++ b/nvx-rs/src/host/sandbox/prepared.rs @@ -70,11 +70,11 @@ use crate::error::Error; use crate::error::Result; use crate::host::filesystem::ExportPlan; use crate::host::launch::{VmmLaunch, fit_process_command_line}; +use crate::host::platform::inherit::Inherited; use crate::host::process::Process; #[cfg(windows)] #[cfg(windows)] use crate::host::seal; -use crate::host::supervisor::Inherited; #[cfg(target_os = "linux")] use crate::host::sys; diff --git a/nvx-rs/src/host/snapshot/key.rs b/nvx-rs/src/host/snapshot/key.rs index c4b5b9b4e..8adda8fc8 100644 --- a/nvx-rs/src/host/snapshot/key.rs +++ b/nvx-rs/src/host/snapshot/key.rs @@ -21,9 +21,9 @@ use crate::error::{Error, Result}; use crate::host::config::{DiskCapture, check_setting}; use crate::host::platform::parse_hex32; use crate::host::process::BootId; +use crate::host::runtime::{ArtifactIdentity, MAX_IDENTITY_LEN, RuntimeIdentity}; use crate::host::sandbox::SandboxNetwork; use crate::host::sandbox::mount::MOUNT_TAG; -use crate::host::store::{ArtifactIdentity, MAX_IDENTITY_LEN, RuntimeIdentity}; use crate::hypervisor::Hypervisor; pub use crate::host::config::Invariants; diff --git a/nvx-rs/src/host/snapshot/tests.rs b/nvx-rs/src/host/snapshot/tests.rs index c99645c03..8c67db400 100644 --- a/nvx-rs/src/host/snapshot/tests.rs +++ b/nvx-rs/src/host/snapshot/tests.rs @@ -20,9 +20,8 @@ use crate::host::config::{ }; use crate::host::network::{Access, NetworkPolicy}; use crate::host::process::BootId; -use crate::host::runtime::{LaunchOptions, Runtime}; +use crate::host::runtime::{ArtifactIdentity, LaunchOptions, Runtime, RuntimeIdentity}; use crate::host::sandbox::SandboxNetwork; -use crate::host::store::{ArtifactIdentity, RuntimeIdentity}; use crate::hypervisor::Hypervisor; use crate::net::Ipv4Cidr; use crate::protocol::root::RootImage;