vmm: Update VmConfig when adding new device

Ensures the configuration is updated after a new device has been
hotplugged. In the event of a reboot, this means the new VM will be
started with the new device that had been previously hotplugged.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-02-28 15:46:50 +01:00
committed by Rob Bradford
parent a86f4369a7
commit c1af13efeb
2 changed files with 15 additions and 4 deletions

View File

@@ -1648,7 +1648,7 @@ impl DeviceManager {
}
#[cfg(feature = "pci_support")]
pub fn add_device(&mut self, path: String) -> DeviceManagerResult<()> {
pub fn add_device(&mut self, path: String) -> DeviceManagerResult<DeviceConfig> {
let device_cfg = DeviceConfig {
path: PathBuf::from(path),
iommu: false,
@@ -1680,7 +1680,7 @@ impl DeviceManager {
// Update the PCIU bitmap
self.pci_devices_up |= 1 << (device_id >> 3);
Ok(())
Ok(device_cfg)
}
}