diff --git a/src/config.rs b/src/config.rs index 805acb44b6..47a78134b2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -4,12 +4,12 @@ pub const DEFAULT_STACK_SIZE: usize = 65_536; pub(crate) const USER_STACK_SIZE: usize = 1_048_576; -#[allow(dead_code)] -#[cfg(feature = "pci")] -pub(crate) const VIRTIO_MAX_QUEUE_SIZE: u16 = 2048; -#[allow(dead_code)] -#[cfg(not(feature = "pci"))] -pub(crate) const VIRTIO_MAX_QUEUE_SIZE: u16 = 1024; +#[cfg(any( + all(any(feature = "tcp", feature = "udp"), not(feature = "rtl8139")), + feature = "fuse", + feature = "vsock" +))] +pub(crate) const VIRTIO_MAX_QUEUE_SIZE: u16 = if cfg!(feature = "pci") { 2048 } else { 1024 }; /// Default keep alive interval in milliseconds #[cfg(feature = "tcp")]