islet
islet copied to clipboard
Properly handling errors in the middle of handlers
e.g.,
listen!(mainloop, rmi::REC_CREATE, |arg, ret, rmm| {
...
rmm.page_table.map(rec, true); // map here
...
rec.set_vtcr(prepare_vtcr(&rd)?); // something goes wrong in the middle. --> we need to unmap "rec" in this case
}
analyze all handler functions in this context, and handle this error properly