remove duplicated structure InitrdConfig

structure InitrdConfig duplicated with InitramfsConfig

Signed-off-by: LiYa'nan <oliverliyn@gmail.com>
This commit is contained in:
LiYa'nan 2020-06-09 11:27:09 +08:00 committed by Rob Bradford
parent afe60808ac
commit 313883f6e4
3 changed files with 4 additions and 12 deletions

View File

@ -14,7 +14,7 @@ use std::ptr::null;
use std::{io, result};
use super::super::DeviceType;
use super::super::InitrdConfig;
use super::super::InitramfsConfig;
use super::get_fdt_addr;
use super::gic::GICDevice;
use super::layout::FDT_MAX_SIZE;
@ -90,7 +90,7 @@ pub fn create_fdt<T: DeviceInfoForFDT + Clone + Debug>(
vcpu_mpidr: Vec<u64>,
device_info: &HashMap<(DeviceType, String), T>,
gic_device: &Box<dyn GICDevice>,
initrd: &Option<InitrdConfig>,
initrd: &Option<InitramfsConfig>,
) -> Result<Vec<u8>> {
// Alocate stuff necessary for the holding the blob.
let mut fdt = vec![0; FDT_MAX_SIZE];
@ -343,7 +343,7 @@ fn create_memory_node(fdt: &mut Vec<u8>, guest_mem: &GuestMemoryMmap) -> Result<
fn create_chosen_node(
fdt: &mut Vec<u8>,
cmdline: &CStr,
initrd: &Option<InitrdConfig>,
initrd: &Option<InitramfsConfig>,
) -> Result<()> {
append_begin_node(fdt, "chosen")?;
append_property_cstring(fdt, "bootargs", cmdline)?;

View File

@ -104,7 +104,7 @@ pub fn configure_system<T: DeviceInfoForFDT + Clone + Debug>(
vcpu_mpidr: Vec<u64>,
device_info: &HashMap<(DeviceType, String), T>,
gic_device: &Box<dyn GICDevice>,
initrd: &Option<super::InitrdConfig>,
initrd: &Option<super::InitramfsConfig>,
) -> super::Result<()> {
let dtb = fdt::create_fdt(
guest_mem,

View File

@ -133,14 +133,6 @@ pub enum DeviceType {
RTC,
}
/// Type for passing information about the initrd in the guest memory.
pub struct InitrdConfig {
/// Load address of initrd in guest memory
pub address: vm_memory::GuestAddress,
/// Size of initrd in guest memory
pub size: usize,
}
/// Default (smallest) memory page size for the supported architectures.
pub const PAGE_SIZE: usize = 4096;