Move denali client to separate lib.

This commit is contained in:
Drew Galbraith 2025-02-07 18:24:48 -08:00
parent c8f84ec352
commit 59efb1659a
10 changed files with 56 additions and 18 deletions

View file

@ -1,4 +1,4 @@
use denali::DenaliClient;
use denali_client::DenaliClient;
use mammoth::{cap::Capability, zion::ZError};
const MBR_SIG: u16 = 0xAA55;
@ -47,9 +47,9 @@ struct PartitionEntry {
}
pub fn read_gpt(mut denali: DenaliClient) -> Result<u64, ZError> {
let resp = denali.read(&denali::ReadRequest {
let resp = denali.read(&denali_client::ReadRequest {
device_id: 0,
block: denali::DiskBlock { lba: 0, size: 2 },
block: denali_client::DiskBlock { lba: 0, size: 2 },
})?;
let first_lbas = mammoth::mem::MemoryRegion::from_cap(Capability::take(resp.memory))?;
@ -99,9 +99,9 @@ pub fn read_gpt(mut denali: DenaliClient) -> Result<u64, ZError> {
num_blocks
);
let resp = denali.read(&denali::ReadRequest {
let resp = denali.read(&denali_client::ReadRequest {
device_id: 0,
block: denali::DiskBlock {
block: denali_client::DiskBlock {
lba: lba_partition_entries,
size: num_blocks,
},

View file

@ -122,7 +122,7 @@ impl YellowstoneServerHandler for YellowstoneServerImpl {
fn get_denali(&mut self) -> Result<DenaliInfo, ZError> {
match self.context.service_map.lock().get("denali") {
Some(ep_cap) => crate::gpt::read_gpt(denali::DenaliClient::new(
Some(ep_cap) => crate::gpt::read_gpt(denali_client::DenaliClient::new(
ep_cap.duplicate(Capability::PERMS_ALL).unwrap(),
))
.map(|lba| DenaliInfo {