mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
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:
@@ -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);
|
||||
|
||||
@@ -309,6 +309,7 @@ pub struct Fs {
|
||||
seccomp_action: SeccompAction,
|
||||
guest_memory: Option<GuestMemoryAtomic<GuestMemoryMmap>>,
|
||||
epoll_thread: Option<thread::JoinHandle<()>>,
|
||||
exit_evt: EventFd,
|
||||
}
|
||||
|
||||
impl Fs {
|
||||
@@ -323,6 +324,7 @@ impl Fs {
|
||||
cache: Option<(VirtioSharedMemoryList, MmapRegion)>,
|
||||
seccomp_action: SeccompAction,
|
||||
restoring: bool,
|
||||
exit_evt: EventFd,
|
||||
) -> Result<Fs> {
|
||||
let mut slave_req_support = false;
|
||||
|
||||
@@ -353,6 +355,7 @@ impl Fs {
|
||||
seccomp_action,
|
||||
guest_memory: None,
|
||||
epoll_thread: None,
|
||||
exit_evt,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -429,6 +432,7 @@ impl Fs {
|
||||
seccomp_action,
|
||||
guest_memory: None,
|
||||
epoll_thread: None,
|
||||
exit_evt,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -556,6 +560,7 @@ impl VirtioDevice for Fs {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioVhostFs,
|
||||
&mut epoll_threads,
|
||||
&self.exit_evt,
|
||||
move || {
|
||||
if let Err(e) = handler.run(paused, paused_sync.unwrap()) {
|
||||
error!("Error running worker: {:?}", e);
|
||||
|
||||
@@ -113,6 +113,7 @@ pub struct Net {
|
||||
ctrl_queue_epoll_thread: Option<thread::JoinHandle<()>>,
|
||||
epoll_thread: Option<thread::JoinHandle<()>>,
|
||||
seccomp_action: SeccompAction,
|
||||
exit_evt: EventFd,
|
||||
}
|
||||
|
||||
impl Net {
|
||||
@@ -124,6 +125,7 @@ impl Net {
|
||||
server: bool,
|
||||
seccomp_action: SeccompAction,
|
||||
restoring: bool,
|
||||
exit_evt: EventFd,
|
||||
) -> Result<Net> {
|
||||
let mut num_queues = vu_cfg.num_queues;
|
||||
|
||||
@@ -152,6 +154,7 @@ impl Net {
|
||||
ctrl_queue_epoll_thread: None,
|
||||
epoll_thread: None,
|
||||
seccomp_action,
|
||||
exit_evt,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -237,6 +240,7 @@ impl Net {
|
||||
ctrl_queue_epoll_thread: None,
|
||||
epoll_thread: None,
|
||||
seccomp_action,
|
||||
exit_evt,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -339,6 +343,7 @@ impl VirtioDevice for Net {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioVhostNetCtl,
|
||||
&mut epoll_threads,
|
||||
&self.exit_evt,
|
||||
move || {
|
||||
if let Err(e) = ctrl_handler.run_ctrl(paused, paused_sync.unwrap()) {
|
||||
error!("Error running worker: {:?}", e);
|
||||
@@ -381,6 +386,7 @@ impl VirtioDevice for Net {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioVhostNet,
|
||||
&mut epoll_threads,
|
||||
&self.exit_evt,
|
||||
move || {
|
||||
if let Err(e) = handler.run(paused, paused_sync.unwrap()) {
|
||||
error!("Error running worker: {:?}", e);
|
||||
|
||||
Reference in New Issue
Block a user