virtio-devices: vhost_user: blk: Cleanup device creation

Prepare the device creation so that it can be factorized in a follow up
commit.

Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
This commit is contained in:
Sebastien Boeuf
2021-05-19 22:33:04 +02:00
parent c549bbd72a
commit 9a7199a116
3 changed files with 60 additions and 49 deletions

View File

@@ -1888,11 +1888,7 @@ impl DeviceManager {
queue_size: disk_cfg.queue_size,
};
let vhost_user_block_device = Arc::new(Mutex::new(
match virtio_devices::vhost_user::Blk::new(
id.clone(),
vu_cfg,
self.seccomp_action.clone(),
) {
match virtio_devices::vhost_user::Blk::new(id.clone(), vu_cfg) {
Ok(vub_device) => vub_device,
Err(e) => {
return Err(DeviceManagerError::CreateVhostUserBlk(e));