mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-03 20:15:45 +00:00
vmm: Remove enable_interrupt_controller()
After adding "get_interrupt_controller()" function in DeviceManager, "enable_interrupt_controller()" became redundant, because the latter one is the a simple wrapper on the interrupt controller. Signed-off-by: Michael Zhao <michael.zhao@arm.com>
This commit is contained in:
parent
9a5f3fc2a7
commit
7f3fa39d81
@ -1257,14 +1257,6 @@ impl DeviceManager {
|
|||||||
self.interrupt_controller.as_ref()
|
self.interrupt_controller.as_ref()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
|
||||||
pub fn enable_interrupt_controller(&self) -> DeviceManagerResult<()> {
|
|
||||||
if let Some(interrupt_controller) = &self.interrupt_controller {
|
|
||||||
interrupt_controller.lock().unwrap().enable().unwrap();
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
fn add_interrupt_controller(
|
fn add_interrupt_controller(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
@ -75,6 +75,8 @@ use vmm_sys_util::terminal::Terminal;
|
|||||||
use arch::aarch64::gic::gicv3::kvm::{KvmGicV3, GIC_V3_SNAPSHOT_ID};
|
use arch::aarch64::gic::gicv3::kvm::{KvmGicV3, GIC_V3_SNAPSHOT_ID};
|
||||||
#[cfg(target_arch = "aarch64")]
|
#[cfg(target_arch = "aarch64")]
|
||||||
use arch::aarch64::gic::kvm::create_gic;
|
use arch::aarch64::gic::kvm::create_gic;
|
||||||
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
use devices::interrupt_controller::{self, InterruptController};
|
||||||
|
|
||||||
/// Errors associated with VM management
|
/// Errors associated with VM management
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -104,7 +106,8 @@ pub enum Error {
|
|||||||
ConfigureSystem(arch::Error),
|
ConfigureSystem(arch::Error),
|
||||||
|
|
||||||
/// Cannot enable interrupt controller
|
/// Cannot enable interrupt controller
|
||||||
EnableInterruptController(device_manager::DeviceManagerError),
|
#[cfg(target_arch = "aarch64")]
|
||||||
|
EnableInterruptController(interrupt_controller::Error),
|
||||||
|
|
||||||
PoisonedState,
|
PoisonedState,
|
||||||
|
|
||||||
@ -1050,10 +1053,15 @@ impl Vm {
|
|||||||
.unwrap()
|
.unwrap()
|
||||||
.set_gic_device(Arc::new(Mutex::new(gic_device)));
|
.set_gic_device(Arc::new(Mutex::new(gic_device)));
|
||||||
|
|
||||||
|
// Activate gic device
|
||||||
self.device_manager
|
self.device_manager
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.enable_interrupt_controller()
|
.get_interrupt_controller()
|
||||||
|
.unwrap()
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.enable()
|
||||||
.map_err(Error::EnableInterruptController)?;
|
.map_err(Error::EnableInterruptController)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -1933,10 +1941,15 @@ impl Vm {
|
|||||||
return Err(MigratableError::Restore(anyhow!("Missing GICv3 snapshot")));
|
return Err(MigratableError::Restore(anyhow!("Missing GICv3 snapshot")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Activate gic device
|
||||||
self.device_manager
|
self.device_manager
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.enable_interrupt_controller()
|
.get_interrupt_controller()
|
||||||
|
.unwrap()
|
||||||
|
.lock()
|
||||||
|
.unwrap()
|
||||||
|
.enable()
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
MigratableError::Restore(anyhow!(
|
MigratableError::Restore(anyhow!(
|
||||||
"Could not enable interrupt controller routing: {:#?}",
|
"Could not enable interrupt controller routing: {:#?}",
|
||||||
|
Loading…
Reference in New Issue
Block a user