From 4d74525bdcb4b5ce1efb21d5608ec79dd756073f Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Tue, 2 Aug 2022 14:13:05 +0200 Subject: [PATCH] vmm: Remove unused "poll_queue" from DiskConfig The parameter "poll_queue" was useful at the time Cloud Hypervisor was responsible for spawning vhost-user backends, as it was carrying the information the vhost-user-block backend should have this option enabled or not. It's been quite some time that we walked away from this design, as we now expect a management layer to be responsible for running vhost-user backends. That's the reason why we can remove "poll_queue" from the DiskConfig structure. Signed-off-by: Sebastien Boeuf --- vmm/src/api/openapi/cloud-hypervisor.yaml | 3 -- vmm/src/config.rs | 36 +---------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index 705293f1f..000789836 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -811,9 +811,6 @@ components: default: false vhost_socket: type: string - poll_queue: - type: boolean - default: true rate_limiter_config: $ref: '#/components/schemas/RateLimiterConfig' pci_segment: diff --git a/vmm/src/config.rs b/vmm/src/config.rs index e88d8ae5d..1c8e93b24 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -959,8 +959,6 @@ pub struct DiskConfig { #[serde(default)] pub vhost_user: bool, pub vhost_socket: Option, - #[serde(default = "default_diskconfig_poll_queue")] - pub poll_queue: bool, #[serde(default)] pub rate_limiter_config: Option, #[serde(default)] @@ -980,10 +978,6 @@ fn default_diskconfig_queue_size() -> u16 { DEFAULT_QUEUE_SIZE_VUBLK } -fn default_diskconfig_poll_queue() -> bool { - true -} - impl Default for DiskConfig { fn default() -> Self { Self { @@ -995,7 +989,6 @@ impl Default for DiskConfig { queue_size: default_diskconfig_queue_size(), vhost_user: false, vhost_socket: None, - poll_queue: default_diskconfig_poll_queue(), id: None, disable_io_uring: false, rate_limiter_config: None, @@ -1008,7 +1001,7 @@ impl DiskConfig { pub const SYNTAX: &'static str = "Disk parameters \ \"path=,readonly=on|off,direct=on|off,iommu=on|off,\ num_queues=,queue_size=,\ - vhost_user=on|off,socket=,poll_queue=on|off,\ + vhost_user=on|off,socket=,\ bw_size=,bw_one_time_burst=,bw_refill_time=,\ ops_size=,ops_one_time_burst=,ops_refill_time=,\ id=,pci_segment=\""; @@ -1024,7 +1017,6 @@ impl DiskConfig { .add("num_queues") .add("vhost_user") .add("socket") - .add("poll_queue") .add("bw_size") .add("bw_one_time_burst") .add("bw_refill_time") @@ -1066,11 +1058,6 @@ impl DiskConfig { .unwrap_or(Toggle(false)) .0; let vhost_socket = parser.get("socket"); - let poll_queue = parser - .convert::("poll_queue") - .map_err(Error::ParseDisk)? - .unwrap_or_else(|| Toggle(default_diskconfig_poll_queue())) - .0; let id = parser.get("id"); let disable_io_uring = parser .convert::("_disable_io_uring") @@ -1132,10 +1119,6 @@ impl DiskConfig { None }; - if parser.is_set("poll_queue") && !vhost_user { - warn!("poll_queue parameter currently only has effect when used vhost_user=true"); - } - Ok(DiskConfig { path, readonly, @@ -1145,7 +1128,6 @@ impl DiskConfig { queue_size, vhost_user, vhost_socket, - poll_queue, rate_limiter_config, id, disable_io_uring, @@ -2901,22 +2883,6 @@ mod tests { ..Default::default() } ); - assert_eq!( - DiskConfig::parse("path=/path/to_file,poll_queue=false")?, - DiskConfig { - path: Some(PathBuf::from("/path/to_file")), - poll_queue: false, - ..Default::default() - } - ); - assert_eq!( - DiskConfig::parse("path=/path/to_file,poll_queue=true")?, - DiskConfig { - path: Some(PathBuf::from("/path/to_file")), - poll_queue: true, - ..Default::default() - } - ); Ok(()) }