vmm: Only generate GED event when new DIMM added

Avoid the ACPI scan in the guest OS when no new DIMM is hotplugged.

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2020-01-17 16:56:45 +00:00
committed by Samuel Ortiz
parent 211786ab42
commit 0ab22fea2c
2 changed files with 13 additions and 8 deletions

View File

@@ -451,12 +451,14 @@ impl MemoryManager {
Ok(slot)
}
pub fn resize(&mut self, desired_ram: u64) -> Result<(), Error> {
if desired_ram >= self.current_ram {
pub fn resize(&mut self, desired_ram: u64) -> Result<bool, Error> {
if desired_ram > self.current_ram {
self.hotplug_ram_region((desired_ram - self.current_ram) as usize)?;
self.current_ram = desired_ram;
Ok(true)
} else {
Ok(false)
}
Ok(())
}
}