WIP: Obtain Host Panic/Boot Failure Messages#2518
Conversation
Co-authored-by: Eliza Weisman <eliza@elizas.website>
| // this would only happen if packrat crashes. We could store some fake info here to | ||
| // continue preparing an ereport, but THAT is going to be a problem anyway because | ||
| // we send ereports to, you guessed it: packrat, which just crashed. | ||
| let response = self |
There was a problem hiding this comment.
There's probably something better we can do here as well, the only failure modes for a write_host_bootfail (and host panic) call are:
- That's illegal (not supported, OR client dies and revokes the lease)
- Packrat died
Neither of these are particulary good things (the former doesn't even matter here), and there might be a better way to express the idolatry IPC API to make this more clear in the generated code.
|
MGS message changes are tracked in oxidecomputer/management-gateway-service#495. |
| pub struct HostInfoWriteOutput { | ||
| pub index: u32, | ||
| pub written: usize, | ||
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, FromBytes, IntoBytes, Immutable)] | ||
| #[repr(C)] | ||
| pub struct HostBootfailReadOutput { | ||
| pub read: usize, | ||
| pub offset: usize, | ||
| pub total_len: usize, | ||
| pub index: u32, | ||
| pub reason: u8, | ||
| pub _pad: [u8; 3], | ||
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, FromBytes, IntoBytes, zerocopy::Immutable)] | ||
| #[repr(C)] | ||
| pub struct HostPanicReadOutput { | ||
| pub read: usize, | ||
| pub offset: usize, | ||
| pub total_len: usize, | ||
| pub index: u32, | ||
| } | ||
|
|
||
| #[derive(Copy, Clone, Debug, FromBytes, IntoBytes, Immutable, KnownLayout)] | ||
| #[repr(C)] | ||
| pub struct HostInfoRequest { | ||
| pub offset: u32, | ||
| pub index: u32, |
There was a problem hiding this comment.
sorry in advance if this feels bikesheddy, but i don't love calling these an index --- it's more of a sequence number or count of the number of times the host has panicked/bootfailed. index to me kind of implies we are storing several of them and you can read any of them, but you really can't.
| let res = if let Some(req) = request { | ||
| self.common.packrat().read_host_panic_fragment( | ||
| task_packrat_api::HostInfoRequest { | ||
| offset: req.offset, | ||
| index: req.index, | ||
| }, | ||
| dest, | ||
| ) | ||
| } else { | ||
| self.common.packrat().read_first_host_panic_fragment(dest) | ||
| }; |
There was a problem hiding this comment.
hm, it seems to me that this would be a bit simpler if we just made the packrat API take an option, too? do we really need two totally separate IPCs?
Not yet complete.
Closes #2504
Currently based on #2503