vmm: Don't factorize vhost-user configurations

We want to set different default configurations for vhost-user-net and
vhost-user-blk, which is the reason why the common part corresponding to
the number of queues and the queue size cannot be embedded.

This prepares for the following commit, matching API and CLI behaviors.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2019-12-10 16:40:32 +01:00
committed by Rob Bradford
parent 793327cff8
commit 5e0bbf9c3b
3 changed files with 28 additions and 35 deletions
+6 -6
View File
@@ -1162,9 +1162,9 @@ impl DeviceManager {
if let Some(vhost_user_net_list_cfg) = &vm_info.vm_cfg.lock().unwrap().vhost_user_net {
for vhost_user_net_cfg in vhost_user_net_list_cfg.iter() {
let vu_cfg = VhostUserConfig {
sock: vhost_user_net_cfg.vu_cfg.sock.clone(),
num_queues: vhost_user_net_cfg.vu_cfg.num_queues,
queue_size: vhost_user_net_cfg.vu_cfg.queue_size,
sock: vhost_user_net_cfg.sock.clone(),
num_queues: vhost_user_net_cfg.num_queues,
queue_size: vhost_user_net_cfg.queue_size,
};
let vhost_user_net_device =
vm_virtio::vhost_user::Net::new(vhost_user_net_cfg.mac, vu_cfg)
@@ -1188,9 +1188,9 @@ impl DeviceManager {
if let Some(vhost_user_blk_list_cfg) = &vm_info.vm_cfg.lock().unwrap().vhost_user_blk {
for vhost_user_blk_cfg in vhost_user_blk_list_cfg.iter() {
let vu_cfg = VhostUserConfig {
sock: vhost_user_blk_cfg.vu_cfg.sock.clone(),
num_queues: vhost_user_blk_cfg.vu_cfg.num_queues,
queue_size: vhost_user_blk_cfg.vu_cfg.queue_size,
sock: vhost_user_blk_cfg.sock.clone(),
num_queues: vhost_user_blk_cfg.num_queues,
queue_size: vhost_user_blk_cfg.queue_size,
};
let vhost_user_blk_device =
vm_virtio::vhost_user::Blk::new(vhost_user_blk_cfg.wce, vu_cfg)