@@ -357,6 +357,11 @@ impl DeviceManager {
357
357
Self :: do_kick_device ( mmio_transport_locked. device ( ) ) ;
358
358
Ok ( ( ) )
359
359
} ) ;
360
+ // Go through PCI VirtIO devices
361
+ for device in self . pci_devices . virtio_devices . values ( ) {
362
+ let virtio_device = device. lock ( ) . expect ( "Poisoned lock" ) . virtio_device ( ) ;
363
+ Self :: do_kick_device ( virtio_device) ;
364
+ }
360
365
}
361
366
362
367
fn do_mark_virtio_queue_memory_dirty (
@@ -380,6 +385,12 @@ impl DeviceManager {
380
385
Self :: do_mark_virtio_queue_memory_dirty ( mmio_transport_locked. device ( ) , mem) ;
381
386
Ok ( ( ) )
382
387
} ) ;
388
+
389
+ // Go through PCI VirtIO devices
390
+ for device in self . pci_devices . virtio_devices . values ( ) {
391
+ let virtio_device = device. lock ( ) . expect ( "Poisoned lock" ) . virtio_device ( ) ;
392
+ Self :: do_mark_virtio_queue_memory_dirty ( virtio_device, mem) ;
393
+ }
383
394
}
384
395
}
385
396
@@ -416,7 +427,7 @@ pub enum DevicePersistError {
416
427
417
428
pub struct DeviceRestoreArgs < ' a > {
418
429
pub mem : & ' a GuestMemoryMmap ,
419
- pub vm : & ' a Vm ,
430
+ pub vm : & ' a Arc < Vm > ,
420
431
pub event_manager : & ' a mut EventManager ,
421
432
pub vcpus_exit_evt : & ' a EventFd ,
422
433
pub vm_resources : & ' a mut VmResources ,
@@ -491,6 +502,12 @@ impl<'a> Persist<'a> for DeviceManager {
491
502
// Restore PCI devices
492
503
let pci_ctor_args = PciDevicesConstructorArgs {
493
504
resource_allocator : & resource_allocator,
505
+ vm : constructor_args. vm . clone ( ) ,
506
+ mem : constructor_args. mem ,
507
+ vm_resources : constructor_args. vm_resources ,
508
+ instance_id : constructor_args. instance_id ,
509
+ restored_from_file : constructor_args. restored_from_file ,
510
+ event_manager : constructor_args. event_manager ,
494
511
} ;
495
512
let pci_devices = PciDevices :: restore ( pci_ctor_args, & state. pci_state ) ?;
496
513
0 commit comments