vm-virtio: vhost-user-net: 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 13:58:10 +02:00
committed by Rob Bradford
parent 46e0b3ff75
commit 354c2a4b3d
2 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -1360,7 +1360,7 @@ impl DeviceManager {
queue_size: net_cfg.queue_size,
};
let vhost_user_net_device = Arc::new(Mutex::new(
vm_virtio::vhost_user::Net::new(net_cfg.mac, vu_cfg)
vm_virtio::vhost_user::Net::new(id, net_cfg.mac, vu_cfg)
.map_err(DeviceManagerError::CreateVhostUserNet)?,
));
self.add_migratable_device(