mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
Wire the previously empty Migratable implementation on VfioPciDevice to VFIO DMA logging so the pages the device writes to guest memory are tracked during a live migration. The Vfio trait gains the DMA logging operations with defaults that report no migration support. Without a virtual IOMMU the device sees an identity mapping of guest memory, so the tracked ranges are the guest memory regions with iova equal to gpa. The requested page size is only a hint, so the device reports back the granularity it actually applied. A device that does not support migration, or one behind a virtual IOMMU, is refused at migration start rather than silently skipping dirty tracking and producing an incorrect log. Under a virtual IOMMU the reported IOVAs are not guest addresses and the logged range set would have to track the mapping changes a guest makes mid migration, so that configuration is out of scope. Signed-off-by: Saravanan D <saravanand@crusoe.ai>