@@ -315,11 +315,10 @@ mod tests {
315315 use super :: * ;
316316 use arch;
317317 use devices:: legacy:: DummyIrqChip ;
318+ use devices:: legacy:: KvmApi ;
318319 use devices:: virtio:: InterruptTransport ;
319- use devices:: {
320- legacy:: KvmIoapic ,
321- virtio:: { ActivateResult , Queue , VirtioDevice } ,
322- } ;
320+
321+ use devices:: virtio:: { ActivateResult , Queue , VirtioDevice } ;
323322 use std:: sync:: Arc ;
324323 use utils:: errno;
325324 use utils:: eventfd:: EventFd ;
@@ -333,7 +332,7 @@ mod tests {
333332 vm : & VmFd ,
334333 guest_mem : GuestMemoryMmap ,
335334 device : Arc < Mutex < dyn devices:: virtio:: VirtioDevice > > ,
336- cmdline : & mut kernel_cmdline:: Cmdline ,
335+ _cmdline : & mut kernel_cmdline:: Cmdline ,
337336 type_id : u32 ,
338337 device_id : & str ,
339338 ) -> Result < u64 > {
@@ -343,7 +342,7 @@ mod tests {
343342 let ( mmio_base, _irq) =
344343 self . register_mmio_device ( vm, mmio_device, type_id, device_id. to_string ( ) ) ?;
345344 #[ cfg( target_arch = "x86_64" ) ]
346- self . add_device_to_cmdline ( cmdline , mmio_base, _irq) ?;
345+ self . add_device_to_cmdline ( _cmdline , mmio_base, _irq) ?;
347346 Ok ( mmio_base)
348347 }
349348 }
@@ -435,7 +434,7 @@ mod tests {
435434 let vm = builder:: setup_vm ( & guest_mem, false ) . unwrap ( ) ;
436435 let mut device_manager =
437436 MMIODeviceManager :: new ( & mut 0xd000_0000 , ( arch:: IRQ_BASE , arch:: IRQ_MAX ) ) ;
438- let _kvmioapic = KvmIoapic :: new ( vm. fd ( ) ) . unwrap ( ) ;
437+ let _kvmapi = KvmApi :: new ( vm. fd ( ) , vcpu_count . into ( ) ) . unwrap ( ) ;
439438
440439 let mut cmdline = kernel_cmdline:: Cmdline :: new ( 4096 ) ;
441440 let dummy = Arc :: new ( Mutex :: new ( DummyDevice :: new ( ) ) ) ;
@@ -455,7 +454,7 @@ mod tests {
455454 let vm = builder:: setup_vm ( & guest_mem, false ) . unwrap ( ) ;
456455 let mut device_manager =
457456 MMIODeviceManager :: new ( & mut 0xd000_0000 , ( arch:: IRQ_BASE , arch:: IRQ_MAX ) ) ;
458- let _kvmioapic = KvmIoapic :: new ( vm. fd ( ) ) . unwrap ( ) ;
457+ let _kvmapi = KvmApi :: new ( vm. fd ( ) , vcpu_count . into ( ) ) . unwrap ( ) ;
459458
460459 let mut cmdline = kernel_cmdline:: Cmdline :: new ( 4096 ) ;
461460
@@ -552,7 +551,7 @@ mod tests {
552551 let start_addr2 = GuestAddress ( 0x1000 ) ;
553552 let guest_mem =
554553 GuestMemoryMmap :: from_ranges ( & [ ( start_addr1, 0x1000 ) , ( start_addr2, 0x1000 ) ] ) . unwrap ( ) ;
555- let vcpu_count = 1 ;
554+ let _vcpu_count = 1 ;
556555 let vm = builder:: setup_vm ( & guest_mem, false ) . unwrap ( ) ;
557556 let mut device_manager =
558557 MMIODeviceManager :: new ( & mut 0xd000_0000 , ( arch:: IRQ_BASE , arch:: IRQ_MAX ) ) ;
0 commit comments