option_parser: Make IntegerList generic

This allows its use for all integer types and will generate an error if
the value is too wide for the type.

Assisted-by: Claude:Opus-4.8
Signed-off-by: Rob Bradford <rbradford@meta.com>
This commit is contained in:
Rob Bradford
2026-07-02 08:12:00 +01:00
parent da80fde887
commit 1a441fb7ed
2 changed files with 39 additions and 29 deletions

View File

@@ -2002,7 +2002,7 @@ impl GenericVhostUserConfig {
.ok_or(Error::ParseGenericVhostUserSockMissing)?;
let IntegerList(queue_sizes) = parser
.convert("queue_sizes")
.convert::<IntegerList>("queue_sizes")
.map_err(Error::ParseGenericVhostUser)?
.ok_or(Error::ParseGenericVhostUserQueueSizeMissing)?;
let device_type_str = parser