Compose selected State Anchor paths over prepared roots

This commit is contained in:
ms2k 2026-07-17 03:58:27 +09:00
commit 4dd2b150d2
3 changed files with 1575 additions and 163 deletions

View file

@ -988,6 +988,8 @@ pub struct StateAnchorOwnership {
pub work_path: Option<HostPath>,
pub merged_path: Option<HostPath>,
pub daemon: PersistedHostProcessOwnership,
pub user_namespace: Option<NamespaceIdentity>,
pub mount_namespace: Option<NamespaceIdentity>,
pub mount: Option<MountIdentity>,
}
@ -1102,6 +1104,8 @@ impl StateAnchorOwnership {
work_path: None,
merged_path: None,
daemon: PersistedHostProcessOwnership::unassigned(),
user_namespace: None,
mount_namespace: None,
mount: None,
}
}
@ -1112,6 +1116,8 @@ impl StateAnchorOwnership {
&& self.work_path.is_none()
&& self.merged_path.is_none()
&& self.daemon.is_unassigned()
&& self.user_namespace.is_none()
&& self.mount_namespace.is_none()
&& self.mount.is_none()
}
@ -1121,6 +1127,8 @@ impl StateAnchorOwnership {
&& self.work_path.is_some()
&& self.merged_path.is_some()
&& self.daemon.is_current_committed()
&& self.user_namespace.is_some()
&& self.mount_namespace.is_some()
&& self.mount.is_some()
}
@ -1133,6 +1141,8 @@ impl StateAnchorOwnership {
validate_option_progress(self.work_path.as_ref(), next.work_path.as_ref())?;
validate_option_progress(self.merged_path.as_ref(), next.merged_path.as_ref())?;
validate_process_progress(&self.daemon, &next.daemon)?;
validate_option_progress(self.user_namespace.as_ref(), next.user_namespace.as_ref())?;
validate_option_progress(self.mount_namespace.as_ref(), next.mount_namespace.as_ref())?;
validate_option_progress(self.mount.as_ref(), next.mount.as_ref())
}
}

View file

@ -396,6 +396,8 @@ fn state_anchor_ownership(
work_path: Some(HostPath::new(b"work".to_vec())),
merged_path: Some(HostPath::new(b"merged".to_vec())),
daemon,
user_namespace: Some(namespace()),
mount_namespace: Some(namespace()),
mount: mount_identity,
}
}

View file

@ -334,6 +334,8 @@ fn every_schema_shape_round_trips_and_rejects_malformed_or_unknown_versions() {
work_path: Some(HostPath::new(b"work".to_vec())),
merged_path: Some(HostPath::new(b"merged".to_vec())),
daemon: owned_process(63),
user_namespace: Some(namespace()),
mount_namespace: Some(namespace()),
mount: Some(mount()),
},
&mut seen,