mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices, vmm: vdpa: Implement live migration support
Vdpa now implements the Migratable trait, which allows the device to be added to the DeviceTree and therefore allows live migrating any vDPA device that supports being suspended. Given a vDPA device can't be resumed from a suspended state without having to reset everything, we don't support pause/resume for a vDPA device, as well as snapshot/restore (which requires resume to be supported). In order for the migration to work locally, reusing the same device on the same host machine, the vhost-vdpa handler is dropped after the snapshot has been performed, which allows the destination VM to open the device without any conflict about the device being busy. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
@@ -2852,6 +2852,7 @@ impl DeviceManager {
|
||||
device_path,
|
||||
self.memory_manager.lock().unwrap().guest_memory(),
|
||||
vdpa_cfg.num_queues as u16,
|
||||
self.restoring,
|
||||
)
|
||||
.map_err(DeviceManagerError::CreateVdpa)?,
|
||||
));
|
||||
@@ -2865,7 +2866,7 @@ impl DeviceManager {
|
||||
self.device_tree
|
||||
.lock()
|
||||
.unwrap()
|
||||
.insert(id.clone(), device_node!(id));
|
||||
.insert(id.clone(), device_node!(id, vdpa_device));
|
||||
|
||||
Ok(MetaVirtioDevice {
|
||||
virtio_device: vdpa_device as Arc<Mutex<dyn virtio_devices::VirtioDevice>>,
|
||||
|
||||
Reference in New Issue
Block a user