From 63eeed29ccc32960af9d0b2013809139a3536c1f Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 18 Mar 2020 09:57:28 +0100 Subject: [PATCH] vm: Comment on the VM config update from memory hotplug I spent a few minutes trying to understand why we were unconditionally updating the VM config memory size, even if the guest memory resizing did not happen. Signed-off-by: Samuel Ortiz --- vmm/src/vm.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vmm/src/vm.rs b/vmm/src/vm.rs index 980d6125d..29d56465a 100755 --- a/vmm/src/vm.rs +++ b/vmm/src/vm.rs @@ -560,6 +560,10 @@ impl Vm { .notify_hotplug(HotPlugNotificationFlags::MEMORY_DEVICES_CHANGED) .map_err(Error::DeviceManager)?; } + + // We update the VM config regardless of the actual guest resize operation + // result (true or false, happened or not), so that if the VM reboots it + // will be running with the last configure memory size. self.config.lock().unwrap().memory.size = desired_memory; } Ok(())