mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-22 03:12:27 +00:00
vmm: Remove VFIO user device from VmConfig
upon device unplug
It ensures we won't recreate the unplugged device on reboot. Signed-off-by: Bo Chen <chen.bo@intel.com>
This commit is contained in:
parent
3c7323230a
commit
455b0d12e9
@ -1392,6 +1392,11 @@ impl Vm {
|
||||
devices.retain(|dev| dev.id.as_ref() != Some(&_id));
|
||||
}
|
||||
|
||||
// Remove if VFIO user device
|
||||
if let Some(user_devices) = config.user_devices.as_mut() {
|
||||
user_devices.retain(|dev| dev.id.as_ref() != Some(&_id));
|
||||
}
|
||||
|
||||
// Remove if disk device
|
||||
if let Some(disks) = config.disks.as_mut() {
|
||||
disks.retain(|dev| dev.id.as_ref() != Some(&_id));
|
||||
|
Loading…
x
Reference in New Issue
Block a user