Commit 5df0587
Restructure guest/host error handling (hyperlight-dev#868)
* Add test that fails due memory leaking when host function error occurs
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Update FlatBuffer schema and generation process
- Add all.fbs to include all schema files in one place
- Restructure function_call_result.fbs to use Result-like union
- Add HostError variant to ErrorCode enum in guest_error.fbs
- Update flatbuffer generation command in Justfile to use all.fbs
- Update documentation for new generation process
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Regenerate FlatBuffer generated code
Update all generated Rust code based on the new schema definitions.
This includes new types for error handling and result structures.
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Refactor error handling types and utilities
- Update function_types.rs to handle Result-like return values
- Simplify guest_error.rs wrapper implementation
- Update util.rs for new generated types
- Update mod.rs for new generated types
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Remove obsolete guest error handling
- Remove guest_err.rs from hyperlight_host (replaced by new error handling)
- Remove guest_err.rs from hyperlight_guest_bin (replaced by new error handling)
- Update func/mod.rs to remove obsolete import
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Update host-side error handling
- Update initialized_multi_use.rs to use new Result-like error handling
- Update mem/mgr.rs to handle host function errors properly
- Update sandbox/outb.rs for new error propagation pattern
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Update guest-side error handling
- Update guest/host_comm.rs to use new Result-like return values
- Update guest_bin/call.rs to properly handle host function errors
- Update guest_bin/lib.rs to remove obsolete error handling import and make GUEST_HANDLE public (for use in C-API)
- Update guest_capi/error.rs to support new error types
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Fix up test to work with new error handling
Update sandbox_host_tests.rs to use the new Result-like error handling pattern.
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Update Cargo dependencies
Update Cargo.lock and Cargo.toml files to reflect the dependency changes
needed for the new error handling implementation.
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Fix test so it passes
Signed-off-by: Ludvig Liljenberg <[email protected]>
* First round of PR feedback
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Unignore forgotten test
Signed-off-by: Ludvig Liljenberg <[email protected]>
* Update flatc version in docs
Signed-off-by: Ludvig Liljenberg <[email protected]>
---------
Signed-off-by: Ludvig Liljenberg <[email protected]>1 parent f6eb18f commit 5df0587
File tree
36 files changed
+1330
-1162
lines changed- docs
- src
- hyperlight_common/src
- flatbuffer_wrappers
- flatbuffers
- hyperlight/generated
- hyperlight_guest_bin
- src
- guest_function
- hyperlight_guest_capi
- src
- hyperlight_guest/src/guest_handle
- hyperlight_host
- src
- func
- mem
- sandbox
- tests
- schema
- tests/rust_guests
- dummyguest
- simpleguest
- src
- witguest
36 files changed
+1330
-1162
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
372 | 372 | | |
373 | 373 | | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
Lines changed: 333 additions & 90 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | | - | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
30 | 25 | | |
31 | 26 | | |
32 | 27 | | |
| |||
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
| 46 | + | |
51 | 47 | | |
52 | 48 | | |
53 | 49 | | |
| |||
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| 72 | + | |
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
| |||
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
| 124 | + | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
| |||
147 | 146 | | |
148 | 147 | | |
149 | 148 | | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
| |||
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 198 | | |
236 | 199 | | |
237 | 200 | | |
| |||
0 commit comments