Skip to content

Commit 130cc69

Browse files
committed
fix: update module visibility and correct image file opening
1 parent 5db0505 commit 130cc69

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/vmm/config.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ use crate::vmm::fdt::*;
1313

1414
use alloc::sync::Arc;
1515

16-
#[allow(clippy::module_inception)]
16+
#[allow(clippy::module_inception, dead_code)]
1717
pub mod config {
1818
use alloc::string::String;
1919
use alloc::vec::Vec;
2020

2121
/// Default static VM configs. Used when no VM config is provided.
22-
#[allow(dead_code)]
2322
pub fn default_static_vm_configs() -> Vec<&'static str> {
2423
vec![
2524
#[cfg(target_arch = "x86_64")]

src/vmm/fdt/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ pub fn get_developer_provided_dtb(
9696
use axerrno::ax_err_type;
9797
use std::io::{BufReader, Read};
9898
if let Some(dtb_path) = &crate_config.kernel.dtb_path {
99-
let (dtb_file, dtb_size) = crate::vmm::images::open_image_file(dtb_path).unwrap();
99+
let (dtb_file, dtb_size) =
100+
crate::vmm::images::fs::open_image_file(dtb_path).unwrap();
100101
info!("DTB file in fs, size: 0x{:x}", dtb_size);
101102

102103
let mut file = BufReader::new(dtb_file);

src/vmm/images/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ pub fn load_vm_image_from_memory(
192192
}
193193

194194
#[cfg(feature = "fs")]
195-
mod fs {
195+
pub mod fs {
196196
use super::*;
197197
use crate::hal::CacheOp;
198198
use axerrno::{AxResult, ax_err, ax_err_type};
@@ -328,6 +328,3 @@ mod fs {
328328
Ok((file, file_size))
329329
}
330330
}
331-
332-
#[cfg(feature = "fs")]
333-
pub use fs::open_image_file;

0 commit comments

Comments
 (0)