devices: fix build with audio feature disabled

When building without the "audio" feature, an import of virtio::snd in
pci_device failed to compile; wrap it in a feature check to fix this.
This fixes the crosvm fuzzer build.

BUG=chromium:1174254
TEST=cargo build --no-default-features
TEST=build crosvm with amd64-generic asan profile

Change-Id: Iecd549c313d6210ee90e9e405c02a9e7581e1141
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2674260
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Manoj Gupta <manojgupta@chromium.org>
This commit is contained in:
Daniel Verkamp 2021-02-03 16:01:16 -08:00 committed by Commit Bot
parent 5545c907d6
commit 9cdd5fb6f0

View file

@ -11,6 +11,7 @@ use resources::{Error as SystemAllocatorFaliure, SystemAllocator};
use crate::pci::pci_configuration;
use crate::pci::{PciAddress, PciInterruptPin};
use crate::{BusAccessInfo, BusDevice};
#[cfg(feature = "audio")]
use crate::virtio::snd::vios_backend::Error as VioSError;
#[derive(Debug)]