mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
In order to move the hypervisor specific parts of the VM exit handling path, we're defining a generic, hypervisor agnostic VM exit enum. This is what the hypervisor's Vcpu run() call should return when the VM exit can not be completely handled through the hypervisor specific bits. For KVM based hypervisors, this means directly forwarding the IO related exits back to the VMM itself. For other hypervisors that e.g. rely on the VMM to decode and emulate instructions, this means the decoding itself would happen in the hypervisor crate exclusively, and the rest of the VM exit handling would be handled through the VMM device model implementation. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Fix test_vm unit test by using the new abstraction and dropping some dead code. Signed-off-by: Wei Liu <liuwe@microsoft.com>
47 lines
904 B
Rust
47 lines
904 B
Rust
// Copyright © 2019 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
|
|
//
|
|
// Copyright © 2020, Microsoft Corporation
|
|
//
|
|
// Copyright 2018-2019 CrowdStrike, Inc.
|
|
//
|
|
//
|
|
|
|
//! A generic abstraction around hypervisor functionality
|
|
//!
|
|
//! This crate offers a trait abstraction for underlying hypervisors
|
|
//!
|
|
//! # Platform support
|
|
//!
|
|
//! - x86_64
|
|
//! - arm64
|
|
//!
|
|
|
|
extern crate serde;
|
|
extern crate serde_derive;
|
|
extern crate serde_json;
|
|
extern crate thiserror;
|
|
#[macro_use]
|
|
extern crate anyhow;
|
|
|
|
/// KVM implementation module
|
|
pub mod kvm;
|
|
|
|
/// Hypevisor related module
|
|
pub mod hypervisor;
|
|
|
|
/// Vm related module
|
|
pub mod vm;
|
|
|
|
/// Architecture specific definitions
|
|
pub mod arch;
|
|
|
|
/// CPU related module
|
|
mod cpu;
|
|
|
|
pub use crate::hypervisor::{Hypervisor, HypervisorError};
|
|
pub use cpu::{HypervisorCpuError, Vcpu, VmExit};
|
|
pub use kvm::*;
|
|
pub use vm::{DataMatch, HypervisorVmError, Vm};
|