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:
@@ -746,10 +746,12 @@ pub struct Mem {
|
||||
hugepages: bool,
|
||||
dma_mapping_handlers: Arc<Mutex<BTreeMap<u32, Arc<dyn ExternalDmaMapping>>>>,
|
||||
blocks_state: Arc<Mutex<BlocksState>>,
|
||||
exit_evt: EventFd,
|
||||
}
|
||||
|
||||
impl Mem {
|
||||
// Create a new virtio-mem device.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
id: String,
|
||||
region: &Arc<GuestRegionMmap>,
|
||||
@@ -758,6 +760,7 @@ impl Mem {
|
||||
numa_node_id: Option<u16>,
|
||||
initial_size: u64,
|
||||
hugepages: bool,
|
||||
exit_evt: EventFd,
|
||||
) -> io::Result<Mem> {
|
||||
let region_len = region.len();
|
||||
|
||||
@@ -835,6 +838,7 @@ impl Mem {
|
||||
(config.region_size / config.block_size)
|
||||
as usize
|
||||
]))),
|
||||
exit_evt,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -961,6 +965,7 @@ impl VirtioDevice for Mem {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioMem,
|
||||
&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