@@ -62,14 +62,19 @@ pub struct Snapshot {
6262 /// require constant-time equality checking
6363 hash : [ u8 ; 32 ] ,
6464
65- /// TODO: this should not necessarily be around in the long term...
65+ /// Preinitialisation entry point for snapshots created directly from a
66+ /// guest binary.
6667 ///
67- /// When creating a snapshot directly from a guest binary, this
68- /// tracks the address that we need to call into before actually
69- /// using a sandbox from this snapshot in order to do
70- /// preinitialisation. Ideally we would either not need to do this
71- /// at all, or do it as part of the snapshot creation process and
72- /// never need this.
68+ /// When creating a snapshot directly from a guest binary, this tracks
69+ /// the address that we need to call into before actually using a
70+ /// sandbox from this snapshot in order to perform guest-side
71+ /// preinitialisation.
72+ ///
73+ /// Long-term, the intention is to run this preinitialisation eagerly as
74+ /// part of the snapshot creation process so that restored sandboxes can
75+ /// begin executing from their normal entry point without requiring this
76+ /// field. Until that refactoring happens, this remains part of the
77+ /// snapshot format and must be preserved.
7378 preinitialise : Option < u64 > ,
7479}
7580
@@ -105,7 +110,8 @@ fn hash(memory: &[u8], regions: &[MemoryRegion]) -> Result<[u8; 32]> {
105110}
106111
107112impl Snapshot {
108- /// Create a new snapshot that runs the guest binary identified by env
113+ /// Create a new snapshot from the guest binary identified by `env`. With the configuration
114+ /// specified in `cfg`.
109115 pub ( crate ) fn from_env < ' a , ' b > (
110116 env : impl Into < GuestEnvironment < ' a , ' b > > ,
111117 cfg : SandboxConfiguration ,
0 commit comments