mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
A VFIO device restored onto a different host has a device path and iommufd that are meaningless there, and an FD backed device cannot serialize a live descriptor into the snapshot at all. Restoring one therefore needs fresh descriptors supplied with the request. RestoreConfig gains vfio_fds, pairing each device id with a cdev FD, and iommufd_fd for the backing iommufd. Both arrive over SCM_RIGHTS on the restore request. vm_restore swaps each named device's stale path or FD for the received one and installs the iommufd before the VM is built, so the device comes up FD backed. The request is rejected when a substituted device lacks the iommufd backend, when an id is unknown or repeated, or when an FD backed device names no replacement. ch-remote gains the vfio_fds and iommufd_fd options and forwards the descriptors through the SCM_RIGHTS pool. Signed-off-by: Saravanan D <saravanand@crusoe.ai>