From e2eb59bcc8c9a1aacf2cb040ef923b33c93d65ed Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Fri, 29 Apr 2022 11:54:53 +0200 Subject: [PATCH] vmm: Remove FsConfig from VmConfig when unplugging fs device All hotpluggable devices were properly removed from the VmConfig when a remove-device command was issued, except for the "fs" type. Fix this lack of support as it is causing the integration tests to fail with the recent addition of verifying that identifiers are unique. Signed-off-by: Sebastien Boeuf (cherry picked from commit a5a2e591c92c383e808c1118b3d2b160dc7d38f0) Signed-off-by: Rob Bradford --- vmm/src/vm.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 2c356e571..4378a8367 100644 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -1477,6 +1477,11 @@ impl Vm { disks.retain(|dev| dev.id.as_ref() != Some(&id)); } + // Remove if fs device + if let Some(fs) = config.fs.as_mut() { + fs.retain(|dev| dev.id.as_ref() != Some(&id)); + } + // Remove if net device if let Some(net) = config.net.as_mut() { net.retain(|dev| dev.id.as_ref() != Some(&id));