From a76cf0865f9050df83faca3d2cce2d909e50b7f0 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 28 Apr 2020 16:04:32 +0100 Subject: [PATCH] vmm: vm: Remove vsock device from config When doing device unplug remove the vsock device from the configuration if present. Signed-off-by: Rob Bradford --- vmm/src/vm.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index a41d2dad0..a4d2f898f 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -741,6 +741,13 @@ impl Vm { if let Some(pmem) = config.pmem.as_mut() { pmem.retain(|dev| dev.id.as_ref() != Some(&_id)); } + + // Remove if vsock device + if let Some(vsock) = config.vsock.as_ref() { + if vsock.id.as_ref() == Some(&_id) { + config.vsock = None; + } + } } self.device_manager