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:
@@ -166,6 +166,7 @@ pub struct Watchdog {
|
||||
reset_evt: EventFd,
|
||||
last_ping_time: Arc<Mutex<Option<Instant>>>,
|
||||
timer: File,
|
||||
exit_evt: EventFd,
|
||||
}
|
||||
|
||||
#[derive(Versionize)]
|
||||
@@ -183,6 +184,7 @@ impl Watchdog {
|
||||
id: String,
|
||||
reset_evt: EventFd,
|
||||
seccomp_action: SeccompAction,
|
||||
exit_evt: EventFd,
|
||||
) -> io::Result<Watchdog> {
|
||||
let avail_features = 1u64 << VIRTIO_F_VERSION_1;
|
||||
let timer_fd = timerfd_create().map_err(|e| {
|
||||
@@ -204,6 +206,7 @@ impl Watchdog {
|
||||
reset_evt,
|
||||
last_ping_time: Arc::new(Mutex::new(None)),
|
||||
timer,
|
||||
exit_evt,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -324,6 +327,7 @@ impl VirtioDevice for Watchdog {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioWatchdog,
|
||||
&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