Add the `IncusMountPlan` and `IncusRuntimePlan` structs
Intent: Define the shared data model that represents a fully resolved, ready-to-execute Incus runtime configuration including planned mount devices with deterministic names and I/O bus settings.
Affected files: crates/pika-cloud/src/incus.rs
@@ -0,0 +1,150 @@
+pub struct IncusMountPlan {
+ pub kind: RuntimeMountKind,
+ pub source: String,
+ pub guest_path: String,
+ pub device_name: String,
+ pub read_only: bool,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub io_bus: Option<String>,
+ #[serde(default)]
+ pub required: bool,
+}
@@ -0,0 +1,150 @@
+pub struct IncusRuntimePlan {
+ pub identity: RuntimeIdentity,
+ pub incus: IncusRuntimeConfig,
+ pub resources: RuntimeResources,
+ pub lifecycle_root: String,
+ pub paths: RuntimePaths,
+ pub policies: RuntimePolicies,
+ pub bootstrap: RuntimeBootstrap,
+ #[serde(default)]
+ pub mounts: Vec<IncusMountPlan>,
A new module crates/pika-cloud/src/incus.rs introduces two key structs:
IncusMountPlan— a resolved mount device entry carrying the device name, source path, guest path, read-only flag, optional I/O bus override, and whether the mount is required.IncusRuntimePlan— the full plan combining identity, Incus project/profile/image config, resource limits, lifecycle paths, policies, bootstrap config, resolved mounts, labels, and metadata.
The plan_mounts function converts raw RuntimeMount entries into IncusMountPlan entries, automatically setting io_bus to virtiofs for read-only mounts via the INCUS_READ_ONLY_DISK_IO_BUS constant.