mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-06 10:32:10 +00:00
crosvm/linux: fix direct compilation error
Fix a compilation error in the --features=direct build caused by CL:3696671. BUG=None TEST=cargo build --no-default-features --features=direct Change-Id: Idb90d4712064b007672589db65d93b0168508a8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3708388 Reviewed-by: Junichi Uekawa <uekawa@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: David Stevens <stevensd@chromium.org>
This commit is contained in:
parent
2dcbb98677
commit
89479b41db
1 changed files with 5 additions and 2 deletions
|
@ -48,6 +48,8 @@ use devices::{HostBackendDeviceProvider, XhciController};
|
|||
use hypervisor::kvm::{Kvm, KvmVcpu, KvmVm};
|
||||
use hypervisor::{HypervisorCap, ProtectionType, Vm, VmCap};
|
||||
use minijail::{self, Minijail};
|
||||
#[cfg(feature = "direct")]
|
||||
use resources::Error as ResourceError;
|
||||
use resources::{AddressRange, Alloc, SystemAllocator};
|
||||
use rutabaga_gfx::RutabagaGralloc;
|
||||
use sync::{Condvar, Mutex};
|
||||
|
@ -1426,8 +1428,9 @@ where
|
|||
#[cfg(feature = "direct")]
|
||||
if let Some(mmio) = &cfg.direct_mmio {
|
||||
for range in mmio.ranges.iter() {
|
||||
sys_allocator
|
||||
.reserve_mmio(range.base, range.len)
|
||||
AddressRange::from_start_and_size(range.base, range.len)
|
||||
.ok_or(ResourceError::OutOfSpace)
|
||||
.and_then(|range| sys_allocator.reserve_mmio(range))
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"failed to reserved direct mmio: {:x}-{:x}",
|
||||
|
|
Loading…
Reference in a new issue