Move IncusGuestRunRequest and schema version constant into the incus submodule
Intent: Colocate the Incus guest-run request type and its schema version constant with the rest of the Incus-specific code in `crates/pika-cloud/src/incus.rs`, rather than leaving them in the crate root.
Affected files: crates/pika-cloud/src/incus.rs, crates/pika-cloud/src/lib.rs
@@ -8,6 +8,7 @@ use crate::spec::{IncusRuntimeConfig, RuntimeIdentity, RuntimeResources, Runtim
+pub const INCUS_GUEST_RUN_REQUEST_SCHEMA_VERSION: u32 = 2;
pub const INCUS_READ_ONLY_DISK_IO_BUS: &str = "virtiofs";
@@ -18,6 +19,15 @@ pub const INCUS_DEVICE_IO_BUS_KEY: &str = "io.bus";
+#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
+#[serde(deny_unknown_fields)]
+pub struct IncusGuestRunRequest {
+ pub schema_version: u32,
+ pub command: String,
+ pub timeout_secs: u64,
+ pub run_as_root: bool,
+}
@@ -25,58 +25,3 @@ pub use spec::{
};
-
-use serde::{Deserialize, Serialize};
-
-pub const INCUS_GUEST_RUN_REQUEST_SCHEMA_VERSION: u32 = 2;
-
-#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
-#[serde(deny_unknown_fields)]
-pub struct IncusGuestRunRequest {
The IncusGuestRunRequest struct and its companion constant INCUS_GUEST_RUN_REQUEST_SCHEMA_VERSION previously lived in crates/pika-cloud/src/lib.rs, the crate root. This branch moves both into crates/pika-cloud/src/incus.rs where all other Incus device constants, mount planning logic, and runtime plan types already reside.
In incus.rs, the constant is added at the top of the public constant block:
pub const INCUS_GUEST_RUN_REQUEST_SCHEMA_VERSION: u32 = 2;
The struct definition follows the existing constant block, keeping its #[serde(deny_unknown_fields)] attribute and all four public fields (schema_version, command, timeout_secs, run_as_root). Note that the derive list changes from Clone, Copy, Debug (the old location mistakenly had Copy on the enum, not the struct) to Clone, Debug — matching what the struct actually needs.
The corresponding declarations and the use serde::{Deserialize, Serialize} import are deleted from lib.rs, which no longer re-exports these items from the crate root.