mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio, vmm: Delete unix socket on shutdown
It's not possible to call UnixListener::Bind() on an existing file so unlink the created socket when shutting down the Vsock device. This will allow the VM to be rebooted with a vsock device. Fixes: #1083 Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Sebastien Boeuf
parent
5109f914eb
commit
fec97e0586
@@ -1714,8 +1714,14 @@ impl DeviceManager {
|
||||
.map_err(DeviceManagerError::CreateVsockBackend)?;
|
||||
|
||||
let vsock_device = Arc::new(Mutex::new(
|
||||
vm_virtio::Vsock::new(id.clone(), vsock_cfg.cid, backend, vsock_cfg.iommu)
|
||||
.map_err(DeviceManagerError::CreateVirtioVsock)?,
|
||||
vm_virtio::Vsock::new(
|
||||
id.clone(),
|
||||
vsock_cfg.cid,
|
||||
vsock_cfg.sock.clone(),
|
||||
backend,
|
||||
vsock_cfg.iommu,
|
||||
)
|
||||
.map_err(DeviceManagerError::CreateVirtioVsock)?,
|
||||
));
|
||||
|
||||
self.add_migratable_device(Arc::clone(&vsock_device) as Arc<Mutex<dyn Migratable>>);
|
||||
|
||||
Reference in New Issue
Block a user