mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-08-20 15:01:16 +00:00
remove duplicated structure InitrdConfig
structure InitrdConfig duplicated with InitramfsConfig Signed-off-by: LiYa'nan <oliverliyn@gmail.com>
This commit is contained in:
parent
afe60808ac
commit
313883f6e4
@ -14,7 +14,7 @@ use std::ptr::null;
|
|||||||
use std::{io, result};
|
use std::{io, result};
|
||||||
|
|
||||||
use super::super::DeviceType;
|
use super::super::DeviceType;
|
||||||
use super::super::InitrdConfig;
|
use super::super::InitramfsConfig;
|
||||||
use super::get_fdt_addr;
|
use super::get_fdt_addr;
|
||||||
use super::gic::GICDevice;
|
use super::gic::GICDevice;
|
||||||
use super::layout::FDT_MAX_SIZE;
|
use super::layout::FDT_MAX_SIZE;
|
||||||
@ -90,7 +90,7 @@ pub fn create_fdt<T: DeviceInfoForFDT + Clone + Debug>(
|
|||||||
vcpu_mpidr: Vec<u64>,
|
vcpu_mpidr: Vec<u64>,
|
||||||
device_info: &HashMap<(DeviceType, String), T>,
|
device_info: &HashMap<(DeviceType, String), T>,
|
||||||
gic_device: &Box<dyn GICDevice>,
|
gic_device: &Box<dyn GICDevice>,
|
||||||
initrd: &Option<InitrdConfig>,
|
initrd: &Option<InitramfsConfig>,
|
||||||
) -> Result<Vec<u8>> {
|
) -> Result<Vec<u8>> {
|
||||||
// Alocate stuff necessary for the holding the blob.
|
// Alocate stuff necessary for the holding the blob.
|
||||||
let mut fdt = vec![0; FDT_MAX_SIZE];
|
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(
|
fn create_chosen_node(
|
||||||
fdt: &mut Vec<u8>,
|
fdt: &mut Vec<u8>,
|
||||||
cmdline: &CStr,
|
cmdline: &CStr,
|
||||||
initrd: &Option<InitrdConfig>,
|
initrd: &Option<InitramfsConfig>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
append_begin_node(fdt, "chosen")?;
|
append_begin_node(fdt, "chosen")?;
|
||||||
append_property_cstring(fdt, "bootargs", cmdline)?;
|
append_property_cstring(fdt, "bootargs", cmdline)?;
|
||||||
|
@ -104,7 +104,7 @@ pub fn configure_system<T: DeviceInfoForFDT + Clone + Debug>(
|
|||||||
vcpu_mpidr: Vec<u64>,
|
vcpu_mpidr: Vec<u64>,
|
||||||
device_info: &HashMap<(DeviceType, String), T>,
|
device_info: &HashMap<(DeviceType, String), T>,
|
||||||
gic_device: &Box<dyn GICDevice>,
|
gic_device: &Box<dyn GICDevice>,
|
||||||
initrd: &Option<super::InitrdConfig>,
|
initrd: &Option<super::InitramfsConfig>,
|
||||||
) -> super::Result<()> {
|
) -> super::Result<()> {
|
||||||
let dtb = fdt::create_fdt(
|
let dtb = fdt::create_fdt(
|
||||||
guest_mem,
|
guest_mem,
|
||||||
|
@ -133,14 +133,6 @@ pub enum DeviceType {
|
|||||||
RTC,
|
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.
|
/// Default (smallest) memory page size for the supported architectures.
|
||||||
pub const PAGE_SIZE: usize = 4096;
|
pub const PAGE_SIZE: usize = 4096;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user