From 7c7fe7091c0220b8d120364af4c2460649d3b4d0 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 2 Jul 2026 08:15:36 +0100 Subject: [PATCH] vmm: config: Replace integer list conversion Now that IntegerList can handle any width number type use that for the queue_sizes parameter on `--generic-vhost-user` Signed-off-by: Rob Bradford --- vmm/src/config.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/vmm/src/config.rs b/vmm/src/config.rs index 53543a1a4..ada66cba9 100644 --- a/vmm/src/config.rs +++ b/vmm/src/config.rs @@ -72,9 +72,6 @@ pub enum Error { /// Generic vhost-user available features is missing #[error("Error parsing --generic-vhost-user: available features missing")] ParseGenericVhostUserAvailFeaturesMissing, - /// Generic vhost-user queue size is too large - #[error("Error parsing --generic-vhost-user: queue size {0} is {1}, but limit is 65535")] - ParseGenericVhostUserQueueSizeTooLarge(usize, u64), /// Generic vhost-user queue size missing #[error("Error parsing --generic-vhost-user: queue size missing")] ParseGenericVhostUserQueueSizeMissing, @@ -2002,7 +1999,7 @@ impl GenericVhostUserConfig { .ok_or(Error::ParseGenericVhostUserSockMissing)?; let IntegerList(queue_sizes) = parser - .convert::("queue_sizes") + .convert::>("queue_sizes") .map_err(Error::ParseGenericVhostUser)? .ok_or(Error::ParseGenericVhostUserQueueSizeMissing)?; let device_type_str = parser @@ -2076,23 +2073,12 @@ impl GenericVhostUserConfig { _ => {} } let pci_common = PciDeviceCommonConfig::parse(vhost_user)?; - let mut converted_queue_sizes: Vec = Vec::new(); - for (offset, &queue_size) in queue_sizes.iter().enumerate() { - match queue_size.try_into() { - Err(_) => { - return Err(Error::ParseGenericVhostUserQueueSizeTooLarge( - offset, queue_size, - )); - } - Ok(queue_size) => converted_queue_sizes.push(queue_size), - } - } Ok(GenericVhostUserConfig { pci_common, socket: socket.into(), device_type, - queue_sizes: converted_queue_sizes, + queue_sizes, }) }