diff --git a/docs/vhost-user-blk-testing.md b/docs/vhost-user-blk-testing.md index c939e5d38..5d1cf389b 100644 --- a/docs/vhost-user-blk-testing.md +++ b/docs/vhost-user-blk-testing.md @@ -76,7 +76,7 @@ VMs run in client mode. They connect to the socket created by the `dpdkvhostuser --memory size=1024M,file=/dev/hugepages \ --kernel linux/arch/x86/boot/compressed/vmlinux.bin \ --cmdline "console=ttyS0 reboot=k panic=1 nomodules i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd root=/dev/vda3 iommu=off" \ - --disk "path=images/clear-kvm.img" "num_queues=4,queue_size=128,vhost_user=true,socket=/var/tmp/vhost.1,wce=true" \ + --disk "path=images/clear-kvm.img" "num_queues=4,queue_size=128,vhost_user=true,socket=/var/tmp/vhost.1" \ --console off \ --serial tty \ --rng diff --git a/src/main.rs b/src/main.rs index b1659e21e..d9238ea61 100755 --- a/src/main.rs +++ b/src/main.rs @@ -763,14 +763,14 @@ mod unit_tests { "--memory", "shared=true", "--disk", - "vhost_user=true,socket=/tmp/socket1,wce=true", + "vhost_user=true,socket=/tmp/socket1", "path=/path/to/disk/2", ], r#"{ "kernel": {"path": "/path/to/kernel"}, "memory" : { "shared": true, "size": 536870912 }, "disks": [ - {"vhost_user":true, "vhost_socket":"/tmp/socket1", "wce":true}, + {"vhost_user":true, "vhost_socket":"/tmp/socket1"}, {"path": "/path/to/disk/2"} ] }"#, diff --git a/tests/integration.rs b/tests/integration.rs index 58a28a536..8768471ef 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -1539,7 +1539,7 @@ mod tests { ( format!( - "vhost_user=true,path={},num_queues={},queue_size=128,wce=true", + "vhost_user=true,path={},num_queues={},queue_size=128", blk_file_path, num_queues, ), None, @@ -1552,7 +1552,7 @@ mod tests { ( format!( - "vhost_user=true,socket={},num_queues={},queue_size=128,wce=true", + "vhost_user=true,socket={},num_queues={},queue_size=128", vubd_socket_path, num_queues, ), Some(daemon_child), @@ -1736,7 +1736,7 @@ mod tests { let (blk_boot_params, daemon_child) = if self_spawned { ( format!( - "vhost_user=true,path={},num_queues={},queue_size=128,wce=true", + "vhost_user=true,path={},num_queues={},queue_size=128", disk_path, num_queues, ), None, @@ -1754,7 +1754,7 @@ mod tests { ( format!( - "vhost_user=true,socket={},num_queues={},queue_size=128,wce=true", + "vhost_user=true,socket={},num_queues={},queue_size=128", vubd_socket_path, num_queues, ), Some(daemon_child), diff --git a/vm-virtio/src/vhost_user/blk.rs b/vm-virtio/src/vhost_user/blk.rs index 4f08284f9..bd585c19b 100644 --- a/vm-virtio/src/vhost_user/blk.rs +++ b/vm-virtio/src/vhost_user/blk.rs @@ -50,7 +50,7 @@ pub struct Blk { impl Blk { /// Create a new vhost-user-blk device - pub fn new(id: String, wce: bool, vu_cfg: VhostUserConfig) -> Result { + pub fn new(id: String, vu_cfg: VhostUserConfig) -> Result { let mut vhost_user_blk = Master::connect(&vu_cfg.sock, vu_cfg.num_queues as u64) .map_err(Error::VhostUserCreateMaster)?; @@ -61,13 +61,10 @@ impl Blk { | 1 << VIRTIO_BLK_F_FLUSH | 1 << VIRTIO_BLK_F_TOPOLOGY | 1 << VIRTIO_RING_F_EVENT_IDX + | 1 << VIRTIO_BLK_F_CONFIG_WCE | 1 << VIRTIO_F_VERSION_1 | VhostUserVirtioFeatures::PROTOCOL_FEATURES.bits(); - if wce { - avail_features |= 1 << VIRTIO_BLK_F_CONFIG_WCE; - } - if vu_cfg.num_queues > 1 { avail_features |= 1 << VIRTIO_BLK_F_MQ; } diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index 3c677d927..4aea18d24 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -454,9 +454,6 @@ components: default: false vhost_socket: type: string - wce: - type: boolean - default: true poll_queue: type: boolean default: true diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 33969c55d..780d3188a 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -561,8 +561,6 @@ pub struct DiskConfig { #[serde(default)] pub vhost_user: bool, pub vhost_socket: Option, - #[serde(default = "default_diskconfig_wce")] - pub wce: bool, #[serde(default = "default_diskconfig_poll_queue")] pub poll_queue: bool, #[serde(default)] @@ -577,10 +575,6 @@ fn default_diskconfig_queue_size() -> u16 { DEFAULT_QUEUE_SIZE_VUBLK } -fn default_diskconfig_wce() -> bool { - true -} - fn default_diskconfig_poll_queue() -> bool { true } @@ -596,7 +590,6 @@ impl Default for DiskConfig { queue_size: default_diskconfig_queue_size(), vhost_user: false, vhost_socket: None, - wce: default_diskconfig_wce(), poll_queue: default_diskconfig_poll_queue(), id: None, } @@ -607,7 +600,7 @@ impl DiskConfig { pub const SYNTAX: &'static str = "Disk parameters \ \"path=,readonly=on|off,iommu=on|off,num_queues=,\ queue_size=,vhost_user=,\ - socket=,wce=,id=\""; + socket=, default true>,id=\""; pub fn parse(disk: &str) -> Result { let mut parser = OptionParser::new(); @@ -620,7 +613,6 @@ impl DiskConfig { .add("num_queues") .add("vhost_user") .add("socket") - .add("wce") .add("poll_queue") .add("id"); parser.parse(disk).map_err(Error::ParseDisk)?; @@ -655,11 +647,6 @@ impl DiskConfig { .unwrap_or(Toggle(false)) .0; let vhost_socket = parser.get("socket"); - let wce = parser - .convert::("wce") - .map_err(Error::ParseDisk)? - .unwrap_or_else(|| Toggle(default_diskconfig_wce())) - .0; let poll_queue = parser .convert::("poll_queue") .map_err(Error::ParseDisk)? @@ -667,10 +654,6 @@ impl DiskConfig { .0; let id = parser.get("id"); - if parser.is_set("wce") && !vhost_user { - warn!("wce parameter currently only has effect when used vhost_user=true"); - } - if parser.is_set("poll_queue") && !vhost_user { warn!("poll_queue parameter currently only has effect when used vhost_user=true"); } @@ -684,7 +667,6 @@ impl DiskConfig { queue_size, vhost_socket, vhost_user, - wce, poll_queue, id, }) @@ -1611,18 +1593,16 @@ mod tests { } ); assert_eq!( - DiskConfig::parse("path=/path/to_file,wce=true")?, + DiskConfig::parse("path=/path/to_file")?, DiskConfig { path: Some(PathBuf::from("/path/to_file")), - wce: true, ..Default::default() } ); assert_eq!( - DiskConfig::parse("path=/path/to_file,wce=false")?, + DiskConfig::parse("path=/path/to_file")?, DiskConfig { path: Some(PathBuf::from("/path/to_file")), - wce: false, ..Default::default() } ); diff --git a/vmm/src/device_manager.rs b/vmm/src/device_manager.rs index 68542b320..06d825793 100644 --- a/vmm/src/device_manager.rs +++ b/vmm/src/device_manager.rs @@ -1336,7 +1336,7 @@ impl DeviceManager { queue_size: disk_cfg.queue_size, }; let vhost_user_block_device = Arc::new(Mutex::new( - vm_virtio::vhost_user::Blk::new(id.clone(), disk_cfg.wce, vu_cfg) + vm_virtio::vhost_user::Blk::new(id.clone(), vu_cfg) .map_err(DeviceManagerError::CreateVhostUserBlk)?, ));