mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-04 19:11:11 +00:00
vmm: Replace device tree value when restoring DeviceManager
When restoring replace the internal value of the device tree rather than replacing the Arc<Mutex<DeviceTree>> itself. This is fixes an issue where the AddressManager has a copy of the the original Arc<Mutex<DeviceTree>> from when the DeviceManager was created. The original restore path only replaced the DeviceManager's version of the Arc<Mutex<DeviceTree>>. Instead replace the contents of the Arc<Mutex<DeviceTree>> so all users see the updated version. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
af770c814b
commit
e1c09b66ba
@ -1167,7 +1167,7 @@ impl DeviceManager {
|
||||
}
|
||||
|
||||
fn set_state(&mut self, state: &DeviceManagerState) {
|
||||
self.device_tree = Arc::new(Mutex::new(state.device_tree.clone()));
|
||||
*self.device_tree.lock().unwrap() = state.device_tree.clone();
|
||||
self.device_id_cnt = state.device_id_cnt;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user