vmm: Trigger hotplug notification to the guest

Whenever the user wants to hotplug a new VFIO PCI device, the VMM will
have to trigger a hotplug notification through the GED device.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf 2020-02-27 14:50:52 +01:00 committed by Rob Bradford
parent 0e58741a09
commit d0218e94a3
2 changed files with 7 additions and 0 deletions

View File

@ -75,5 +75,6 @@ bitflags! {
const NO_DEVICES_CHANGED = 0;
const CPU_DEVICES_CHANGED = 0b1;
const MEMORY_DEVICES_CHANGED = 0b10;
const PCI_DEVICES_CHANGED = 0b100;
}
}

View File

@ -547,6 +547,12 @@ impl Vm {
.add_device(path)
.map_err(Error::DeviceManager)?;
self.devices
.lock()
.unwrap()
.notify_hotplug(HotPlugNotificationFlags::PCI_DEVICES_CHANGED)
.map_err(Error::DeviceManager)?;
Ok(())
}