vm-virtio: rng: 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-27 11:39:41 +02:00
committed by Rob Bradford
parent 9eb7413fab
commit 2e91b73881
2 changed files with 8 additions and 10 deletions

View File

@@ -1437,7 +1437,7 @@ impl DeviceManager {
let id = String::from(RNG_DEVICE_NAME);
let virtio_rng_device = Arc::new(Mutex::new(
vm_virtio::Rng::new(rng_path, rng_config.iommu)
vm_virtio::Rng::new(id.clone(), rng_path, rng_config.iommu)
.map_err(DeviceManagerError::CreateVirtioRng)?,
));
devices.push((