@@ -27,7 +27,6 @@ use linux_loader::configurator::linux::LinuxBootConfigurator;
27
27
use linux_loader:: configurator:: pvh:: PvhBootConfigurator ;
28
28
use linux_loader:: configurator:: { BootConfigurator , BootParams } ;
29
29
use linux_loader:: loader:: bootparam:: boot_params;
30
-
31
30
use linux_loader:: loader:: elf:: start_info:: {
32
31
hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info,
33
32
} ;
@@ -136,7 +135,8 @@ pub fn configure_system(
136
135
boot_prot : BootProtocol ,
137
136
) -> Result < ( ) , ConfigurationError > {
138
137
// Note that this puts the mptable at the last 1k of Linux's 640k base RAM
139
- mptable:: setup_mptable ( guest_mem, resource_allocator, num_cpus) . map_err ( ConfigurationError :: MpTableSetup ) ?;
138
+ mptable:: setup_mptable ( guest_mem, resource_allocator, num_cpus)
139
+ . map_err ( ConfigurationError :: MpTableSetup ) ?;
140
140
141
141
match boot_prot {
142
142
BootProtocol :: PvhBoot => {
@@ -214,6 +214,7 @@ fn configure_pvh(
214
214
// boot_params. This will be stored at PVH_INFO_START address, and %rbx
215
215
// will be initialized to contain PVH_INFO_START prior to starting the
216
216
// guest, as required by the PVH ABI.
217
+ #[ allow( clippy:: cast_possible_truncation) ] // the vec lenghts are single digit integers
217
218
let mut start_info = hvm_start_info {
218
219
magic : XEN_HVM_START_MAGIC_VALUE ,
219
220
version : 1 ,
@@ -275,10 +276,11 @@ fn configure_64bit_boot(
275
276
276
277
let himem_start = GuestAddress ( layout:: HIMEM_START ) ;
277
278
278
- let mut params = boot_params:: default ( ) ;
279
-
280
279
// Set the location of RSDP in Boot Parameters to help the guest kernel find it faster.
281
- params. acpi_rsdp_addr = layout:: RSDP_ADDR ;
280
+ let mut params = boot_params {
281
+ acpi_rsdp_addr : layout:: RSDP_ADDR ,
282
+ ..boot_params:: default ( )
283
+ } ;
282
284
params. hdr . type_of_loader = KERNEL_LOADER_OTHER ;
283
285
params. hdr . boot_flag = KERNEL_BOOT_FLAG_MAGIC ;
284
286
params. hdr . header = KERNEL_HDR_MAGIC ;
@@ -388,8 +390,15 @@ mod tests {
388
390
let no_vcpus = 4 ;
389
391
let gm = single_region_mem ( 0x10000 ) ;
390
392
let mut resource_allocator = ResourceAllocator :: new ( ) . unwrap ( ) ;
391
- let config_err =
392
- configure_system ( & gm, & mut resource_allocator, GuestAddress ( 0 ) , 0 , & None , 1 , BootProtocol :: LinuxBoot ) ;
393
+ let config_err = configure_system (
394
+ & gm,
395
+ & mut resource_allocator,
396
+ GuestAddress ( 0 ) ,
397
+ 0 ,
398
+ & None ,
399
+ 1 ,
400
+ BootProtocol :: LinuxBoot ,
401
+ ) ;
393
402
assert_eq ! (
394
403
config_err. unwrap_err( ) ,
395
404
super :: ConfigurationError :: MpTableSetup ( mptable:: MptableError :: NotEnoughMemory )
0 commit comments