From 1e557fdb3c81d65ceb607724e066d89d1a104319 Mon Sep 17 00:00:00 2001 From: LiHui Date: Fri, 29 Apr 2022 16:50:38 +0800 Subject: [PATCH] vmm: api: Do not delete the API socket on API server creation The socket will safely deleted on shutdown and so it is not necessary to delete the API socket when starting the HTTP server. Fixes: #4026 Signed-off-by: LiHui Signed-off-by: Rob Bradford (cherry picked from commit ec0c1b01c4617c242944bcf6f55fdfb28bb9dbc6) Signed-off-by: Rob Bradford --- vmm/src/api/http.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/vmm/src/api/http.rs b/vmm/src/api/http.rs index 9fa86e4a6..fb937c35d 100644 --- a/vmm/src/api/http.rs +++ b/vmm/src/api/http.rs @@ -336,7 +336,6 @@ pub fn start_http_path_thread( seccomp_action: &SeccompAction, exit_evt: EventFd, ) -> Result>> { - std::fs::remove_file(path).unwrap_or_default(); let socket_path = PathBuf::from(path); let socket_fd = UnixListener::bind(socket_path).map_err(Error::CreateApiServerSocket)?; let server =