Skip to content

Commit 224fe30

Browse files
authored
Optimize configuration file (#14)
1 parent f431309 commit 224fe30

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/config.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,25 @@ pub struct AxVMConfig {
6363
impl From<AxVMCrateConfig> for AxVMConfig {
6464
fn from(cfg: AxVMCrateConfig) -> Self {
6565
Self {
66-
id: cfg.id,
67-
name: cfg.name,
68-
vm_type: VMType::from(cfg.vm_type),
69-
cpu_num: cfg.cpu_num,
70-
phys_cpu_ids: cfg.phys_cpu_ids,
71-
phys_cpu_sets: cfg.phys_cpu_sets,
66+
id: cfg.base.id,
67+
name: cfg.base.name,
68+
vm_type: VMType::from(cfg.base.vm_type),
69+
cpu_num: cfg.base.cpu_num,
70+
phys_cpu_ids: cfg.base.phys_cpu_ids,
71+
phys_cpu_sets: cfg.base.phys_cpu_sets,
7272
cpu_config: AxVCpuConfig {
73-
bsp_entry: GuestPhysAddr::from(cfg.entry_point),
74-
ap_entry: GuestPhysAddr::from(cfg.entry_point),
73+
bsp_entry: GuestPhysAddr::from(cfg.kernel.entry_point),
74+
ap_entry: GuestPhysAddr::from(cfg.kernel.entry_point),
7575
},
7676
image_config: VMImageConfig {
77-
kernel_load_gpa: GuestPhysAddr::from(cfg.kernel_load_addr),
78-
bios_load_gpa: cfg.bios_load_addr.map(GuestPhysAddr::from),
79-
dtb_load_gpa: cfg.dtb_load_addr.map(GuestPhysAddr::from),
80-
ramdisk_load_gpa: cfg.ramdisk_load_addr.map(GuestPhysAddr::from),
77+
kernel_load_gpa: GuestPhysAddr::from(cfg.kernel.kernel_load_addr),
78+
bios_load_gpa: cfg.kernel.bios_load_addr.map(GuestPhysAddr::from),
79+
dtb_load_gpa: cfg.kernel.dtb_load_addr.map(GuestPhysAddr::from),
80+
ramdisk_load_gpa: cfg.kernel.ramdisk_load_addr.map(GuestPhysAddr::from),
8181
},
82-
memory_regions: cfg.memory_regions,
83-
emu_devices: cfg.emu_devices,
84-
pass_through_devices: cfg.passthrough_devices,
82+
memory_regions: cfg.kernel.memory_regions,
83+
emu_devices: cfg.devices.emu_devices,
84+
pass_through_devices: cfg.devices.passthrough_devices,
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)