mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-10 20:19:07 +00:00
Fix ChromeOS build
Fix a crosvm-direct build breakage and some audio_cras build breakages and clippy warnings. BUG=None TEST=emerge-brya-manatee crosvm Change-Id: I480f0b32b531110d5397c171446ab0dccc7d8808 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3802785 Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org> Commit-Queue: David Stevens <stevensd@chromium.org> Tested-by: David Stevens <stevensd@chromium.org>
This commit is contained in:
parent
fd5c835a5b
commit
28c318fa20
3 changed files with 12 additions and 13 deletions
|
@ -13,8 +13,6 @@ use base::RawDescriptor;
|
|||
#[cfg(windows)]
|
||||
use base::Tube;
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasClient;
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasClientType;
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasSocketType;
|
||||
|
|
|
@ -4,8 +4,14 @@
|
|||
|
||||
use audio_streams::shm_streams::NullShmStreamSource;
|
||||
use audio_streams::shm_streams::ShmStreamSource;
|
||||
use base::error;
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasClient;
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasClientType;
|
||||
#[cfg(feature = "audio_cras")]
|
||||
use libcras::CrasSocketType;
|
||||
use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use vm_memory::GuestMemory;
|
||||
|
||||
use crate::pci::ac97::Ac97Dev;
|
||||
|
@ -26,10 +32,10 @@ pub enum Ac97Backend {
|
|||
impl Ac97Dev {
|
||||
pub(in crate::pci::ac97) fn initialize_backend(
|
||||
ac97_backend: &Ac97Backend,
|
||||
mem: GuestMemory,
|
||||
#[allow(unused_variables)] mem: GuestMemory,
|
||||
#[allow(unused_variables)] param: &Ac97Parameters,
|
||||
) -> Result<Self> {
|
||||
match ac97_backend {
|
||||
match *ac97_backend {
|
||||
#[cfg(feature = "audio_cras")]
|
||||
Ac97Backend::Cras => Self::create_cras_audio_device(param, mem.clone()).or_else(|e| {
|
||||
error!(
|
||||
|
@ -38,10 +44,6 @@ impl Ac97Dev {
|
|||
);
|
||||
Ok(Self::create_null_audio_device(mem))
|
||||
}),
|
||||
_ => {
|
||||
error!("Invalid ac97_backend. Fallback to null audio device");
|
||||
Ok(Self::create_null_audio_device(mem))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,10 +73,9 @@ impl Ac97Dev {
|
|||
/// Return the minijail policy file path for the current Ac97Dev.
|
||||
pub fn minijail_policy(&self) -> &'static str {
|
||||
match &self.backend {
|
||||
crate::pci::ac97::Ac97Backend::System(backend) => match backend {
|
||||
crate::pci::ac97::Ac97Backend::System(backend) => match *backend {
|
||||
#[cfg(feature = "audio_cras")]
|
||||
Ac97Backend::Cras => "cras_audio_device",
|
||||
_ => "null_audio_device",
|
||||
},
|
||||
crate::pci::ac97::Ac97Backend::NULL => "null_audio_device",
|
||||
}
|
||||
|
|
|
@ -323,7 +323,7 @@ impl TouchDeviceOption {
|
|||
}
|
||||
|
||||
/// If the user specifies the size, use it. Otherwise, use the default values.
|
||||
#[cfg(feature = "gpu")]
|
||||
#[cfg(any(unix, feature = "gpu"))]
|
||||
pub fn get_size(&self) -> (u32, u32) {
|
||||
(
|
||||
self.width.unwrap_or(self.default_width),
|
||||
|
|
Loading…
Reference in a new issue