devices: ioapic: Expect an identifier upon device creation

This identifier is chosen from the DeviceManager so that it will manage
all identifiers across the VM, which will ensure uniqueness.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2020-04-28 15:26:35 +02:00
committed by Rob Bradford
parent 556871570e
commit 14350f5de4
2 changed files with 16 additions and 17 deletions

View File

@@ -903,11 +903,11 @@ impl DeviceManager {
address_manager: &Arc<AddressManager>,
interrupt_manager: Arc<dyn InterruptManager<GroupConfig = MsiIrqGroupConfig>>,
) -> DeviceManagerResult<Arc<Mutex<ioapic::Ioapic>>> {
let _id = String::from(IOAPIC_DEVICE_NAME);
let id = String::from(IOAPIC_DEVICE_NAME);
// Create IOAPIC
let ioapic = Arc::new(Mutex::new(
ioapic::Ioapic::new(APIC_START, interrupt_manager)
ioapic::Ioapic::new(id, APIC_START, interrupt_manager)
.map_err(DeviceManagerError::CreateIoapic)?,
));