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:
@@ -264,6 +264,7 @@ pub struct Pmem {
|
||||
config: VirtioPmemConfig,
|
||||
mapping: UserspaceMapping,
|
||||
seccomp_action: SeccompAction,
|
||||
exit_evt: EventFd,
|
||||
|
||||
// Hold ownership of the memory that is allocated for the device
|
||||
// which will be automatically dropped when the device is dropped
|
||||
@@ -280,6 +281,7 @@ pub struct PmemState {
|
||||
impl VersionMapped for PmemState {}
|
||||
|
||||
impl Pmem {
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn new(
|
||||
id: String,
|
||||
disk: File,
|
||||
@@ -288,6 +290,7 @@ impl Pmem {
|
||||
_region: MmapRegion,
|
||||
iommu: bool,
|
||||
seccomp_action: SeccompAction,
|
||||
exit_evt: EventFd,
|
||||
) -> io::Result<Pmem> {
|
||||
let config = VirtioPmemConfig {
|
||||
start: addr.raw_value().to_le(),
|
||||
@@ -315,6 +318,7 @@ impl Pmem {
|
||||
mapping,
|
||||
seccomp_action,
|
||||
_region,
|
||||
exit_evt,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -396,6 +400,7 @@ impl VirtioDevice for Pmem {
|
||||
&self.seccomp_action,
|
||||
Thread::VirtioPmem,
|
||||
&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