virtio-devices, vmm: Shutdown VMM on virtio thread panic

Shutdown the VMM in the virtio (or VMM side of vhost-user) thread
panics.

See: #3031

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2021-09-07 16:10:48 +01:00
parent 54e523c302
commit 687d646c60
18 changed files with 147 additions and 14 deletions
+5
View File
@@ -59,6 +59,7 @@ pub struct Blk {
guest_memory: Option<GuestMemoryAtomic<GuestMemoryMmap>>,
epoll_thread: Option<thread::JoinHandle<()>>,
seccomp_action: SeccompAction,
exit_evt: EventFd,
}
impl Blk {
@@ -68,6 +69,7 @@ impl Blk {
vu_cfg: VhostUserConfig,
restoring: bool,
seccomp_action: SeccompAction,
exit_evt: EventFd,
) -> Result<Blk> {
let num_queues = vu_cfg.num_queues;
@@ -93,6 +95,7 @@ impl Blk {
guest_memory: None,
epoll_thread: None,
seccomp_action,
exit_evt,
});
}
@@ -180,6 +183,7 @@ impl Blk {
guest_memory: None,
epoll_thread: None,
seccomp_action,
exit_evt,
})
}
@@ -314,6 +318,7 @@ impl VirtioDevice for Blk {
&self.seccomp_action,
Thread::VirtioVhostBlock,
&mut epoll_threads,
&self.exit_evt,
move || {
if let Err(e) = handler.run(paused, paused_sync.unwrap()) {
error!("Error running worker: {:?}", e);