mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
devices, vmm: Use a bit field for ACPI GED interrupt type
Use independent bits for storing whether there is a CPU or memory device changed when reporting changes via ACPI GED interrupt. This prevents a later notification squashing an earlier one and ensure that hotplugging both CPU and memory at the same time succeeds. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
d2d1248342
commit
7310ab6fa7
@@ -6,6 +6,8 @@
|
||||
// found in the LICENSE-BSD-3-Clause file.
|
||||
|
||||
//! Emulates virtual and hardware devices.
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
extern crate byteorder;
|
||||
extern crate epoll;
|
||||
extern crate kvm_bindings;
|
||||
@@ -71,9 +73,10 @@ pub trait Interrupt: Send + Sync {
|
||||
fn deliver(&self) -> result::Result<(), std::io::Error>;
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum HotPlugNotificationType {
|
||||
NoDevicesChanged,
|
||||
CPUDevicesChanged,
|
||||
MemoryDevicesChanged,
|
||||
bitflags! {
|
||||
pub struct HotPlugNotificationFlags: u8 {
|
||||
const NO_DEVICES_CHANGED = 0;
|
||||
const CPU_DEVICES_CHANGED = 0b1;
|
||||
const MEMORY_DEVICES_CHANGED = 0b10;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user