From 7f032c8bb38efb88d87ed646b05990434d956443 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 6 Feb 2020 12:17:59 +0000 Subject: [PATCH] bin: vhost_user_fs: Shutdown worker thread on exit This will ensure a clean shutdown of the backend Signed-off-by: Rob Bradford --- src/bin/vhost_user_fs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bin/vhost_user_fs.rs b/src/bin/vhost_user_fs.rs index aaa37bcb5..3449ca19c 100644 --- a/src/bin/vhost_user_fs.rs +++ b/src/bin/vhost_user_fs.rs @@ -241,6 +241,10 @@ fn main() { if let Err(e) = daemon.wait() { error!("Waiting for daemon failed: {:?}", e); - process::exit(1); + } + + let kill_evt = &fs_backend.read().unwrap().kill_evt; + if let Err(e) = kill_evt.write(1) { + error!("Error shutting down worker thread: {:?}", e) } }