mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vm-virtio: console: 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:
committed by
Rob Bradford
parent
354c2a4b3d
commit
052eff1ca7
@@ -1099,13 +1099,14 @@ impl DeviceManager {
|
||||
};
|
||||
let (col, row) = get_win_size();
|
||||
let console_input = if let Some(writer) = console_writer {
|
||||
let id = String::from(CONSOLE_DEVICE_NAME);
|
||||
let (virtio_console_device, console_input) =
|
||||
vm_virtio::Console::new(writer, col, row, console_config.iommu)
|
||||
vm_virtio::Console::new(id.clone(), writer, col, row, console_config.iommu)
|
||||
.map_err(DeviceManagerError::CreateVirtioConsole)?;
|
||||
virtio_devices.push((
|
||||
Arc::new(Mutex::new(virtio_console_device)) as VirtioDeviceArc,
|
||||
console_config.iommu,
|
||||
Some(String::from(CONSOLE_DEVICE_NAME)),
|
||||
Some(id),
|
||||
));
|
||||
Some(console_input)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user