[Yellowstone] add ability to read GPT.

This commit is contained in:
Drew Galbraith 2024-08-18 11:36:25 -07:00
parent 090441ad04
commit b880c11ac7
3 changed files with 153 additions and 1 deletions

View file

@ -88,6 +88,19 @@ impl YellowstoneServerHandler for YellowstoneServerImpl {
}
fn get_denali(&mut self) -> Result<DenaliInfo, ZError> {
todo!()
match self.service_map.get("denali") {
Some(ep_cap) => crate::gpt::read_gpt(denali::DenaliClient::new(
ep_cap.duplicate(Capability::PERMS_ALL).unwrap(),
))
.map(|lba| DenaliInfo {
denali_endpoint: ep_cap.duplicate(Capability::PERMS_ALL).unwrap().release(),
device_id: 0,
lba_offset: lba,
}),
None => {
mammoth::debug!("Denali not yet registered");
Err(ZError::FAILED_PRECONDITION)
}
}
}
}