refactor(#2352): subvolume snapshot ops via daemon wire commands

This commit is contained in:
damocles 2026-07-15 00:33:57 +02:00 committed by mara
commit 7b54e7aa50
3 changed files with 138 additions and 29 deletions

View file

@ -188,6 +188,30 @@ pub enum HostRequest {
#[serde(default)]
name: Option<String>,
},
/// Migrate an agent's plain state dir to a btrfs subvolume via the
/// privileged helper (`hivectl subvol upgrade`). The agent MUST already
/// be stopped — the client orchestrates stop → this → start. Returns a
/// bare success; the client prints its own progress lines.
UpgradeSubvolume { name: String },
/// Create a read-only btrfs snapshot of an agent's state subvolume
/// (`hivectl subvol snapshot create`). `label` is validated client-side
/// AND by hive-priv. Returns the snapshot's host path in
/// [`HostResponse::messages`].
SnapshotSubvolume { name: String, label: String },
/// Delete a snapshot created by `SnapshotSubvolume` (`hivectl subvol
/// snapshot delete`). Bare success; the client prints the confirmation.
DeleteSnapshot { name: String, label: String },
/// Export a snapshot to a local file via `btrfs send` (`hivectl subvol
/// snapshot send`). `dest` is a bare filename (hive-priv rejects paths);
/// `parent` names an optional parent snapshot for an incremental send.
/// Returns the written file's host path in [`HostResponse::messages`].
SendSnapshot {
name: String,
label: String,
#[serde(default)]
parent: Option<String>,
dest: String,
},
}
/// One agent's btrfs qgroup usage row — the [`HostRequest::QuotaShow`]