mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
arch: Switch to hypervisor crate
Removed the dependency on kvm-bindings and kvm-ioctls, use hypervisor crate instead. Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
e7288888cf
commit
6c8749adf2
@@ -8,11 +8,11 @@ pub mod kvm {
|
||||
use super::super::gic::kvm::KvmGICDevice;
|
||||
use super::super::gic::{Error, GICDevice};
|
||||
use super::super::gicv3::kvm::KvmGICv3;
|
||||
use kvm_ioctls::DeviceFd;
|
||||
use hypervisor::kvm::kvm_bindings;
|
||||
|
||||
pub struct KvmGICv3ITS {
|
||||
/// The file descriptor for the KVM device
|
||||
fd: DeviceFd,
|
||||
device: Arc<dyn hypervisor::Device>,
|
||||
|
||||
/// GIC device properties, to be used for setting up the fdt entry
|
||||
gic_properties: [u64; 4],
|
||||
@@ -37,8 +37,8 @@ pub mod kvm {
|
||||
}
|
||||
|
||||
impl GICDevice for KvmGICv3ITS {
|
||||
fn device_fd(&self) -> &DeviceFd {
|
||||
&self.fd
|
||||
fn device(&self) -> &Arc<dyn hypervisor::Device> {
|
||||
&self.device
|
||||
}
|
||||
|
||||
fn fdt_compatibility(&self) -> &str {
|
||||
@@ -75,9 +75,12 @@ pub mod kvm {
|
||||
KvmGICv3::version()
|
||||
}
|
||||
|
||||
fn create_device(fd: DeviceFd, vcpu_count: u64) -> Box<dyn GICDevice> {
|
||||
fn create_device(
|
||||
device: Arc<dyn hypervisor::Device>,
|
||||
vcpu_count: u64,
|
||||
) -> Box<dyn GICDevice> {
|
||||
Box::new(KvmGICv3ITS {
|
||||
fd: fd,
|
||||
device: device,
|
||||
gic_properties: [
|
||||
KvmGICv3::get_dist_addr(),
|
||||
KvmGICv3::get_dist_size(),
|
||||
|
||||
Reference in New Issue
Block a user