Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ pe = ["elf"]
elf = []

[dependencies]
vm-memory = ">=0.16.0, <=0.17.1"
vm-memory = { version = ">=0.16.0, <=0.18.0", default-features = false }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vm-memory = { version = ">=0.16.0, <=0.18.0", default-features = false }
vm-memory = { version = ">=0.16.0, <0.19", default-features = false }

Otherwise, when 0.18.1 comes out, it won't be considered compatible, even though it won't have breaking changes.


[dev-dependencies]
criterion = { version = "0.7.0", features = ["html_reports"] }
vm-memory = { version = ">=0.16.0, <=0.17.1", features = ["backend-mmap"] }
criterion = { version = "0.8.1", features = ["html_reports"] }
vm-memory = { version = ">=0.16.0, <=0.18.0", default-features = false, features = ["backend-mmap"] }

[[bench]]
name = "main"
Expand Down
4 changes: 2 additions & 2 deletions src/configurator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#![cfg(any(feature = "elf", feature = "pe", feature = "bzimage"))]

use vm_memory::{Address, ByteValued, GuestAddress, GuestMemory};
use vm_memory::{Address, ByteValued, GuestAddress, GuestMemory, GuestMemoryBackend};

use std::fmt;

Expand Down Expand Up @@ -123,7 +123,7 @@ pub trait BootConfigurator {
/// * `guest_memory` - guest's physical memory.
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
where
M: GuestMemory;
M: GuestMemory + GuestMemoryBackend;
}

/// Boot parameters to be written in guest memory.
Expand Down
4 changes: 2 additions & 2 deletions src/configurator/x86_64/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//! Traits and structs for configuring and loading boot parameters on `x86_64` using the Linux
//! boot protocol.

use vm_memory::{Bytes, GuestMemory};
use vm_memory::{Bytes, GuestMemory, GuestMemoryBackend};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this trait introduced in vm-memory 0.18.0? How does this work with the lower versions of vm-memory that are still marked as compatible?


use crate::configurator::{BootConfigurator, BootParams, Error as BootConfiguratorError, Result};

Expand Down Expand Up @@ -97,7 +97,7 @@ impl BootConfigurator for LinuxBootConfigurator {
/// [`boot_params`]: ../loader/bootparam/struct.boot_params.html
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
where
M: GuestMemory,
M: GuestMemory + GuestMemoryBackend,
{
// The VMM has filled a `boot_params` struct and its e820 map.
// This will be written in guest memory at the zero page.
Expand Down
4 changes: 2 additions & 2 deletions src/configurator/x86_64/pvh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#![cfg(any(feature = "elf", feature = "bzimage"))]

use vm_memory::{ByteValued, Bytes, GuestMemory};
use vm_memory::{ByteValued, Bytes, GuestMemory, GuestMemoryBackend};

use crate::configurator::{BootConfigurator, BootParams, Error as BootConfiguratorError, Result};
use crate::loader_gen::start_info::{hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info};
Expand Down Expand Up @@ -145,7 +145,7 @@ impl BootConfigurator for PvhBootConfigurator {
/// ```
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
where
M: GuestMemory,
M: GuestMemory + GuestMemoryBackend,
{
// The VMM has filled an `hvm_start_info` struct and a `Vec<hvm_memmap_table_entry>`
// and has passed them on to this function.
Expand Down
6 changes: 4 additions & 2 deletions src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ use std::io::{Read, Seek};

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
use vm_memory::ByteValued;
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestUsize, ReadVolatile};
use vm_memory::{
Address, Bytes, GuestAddress, GuestMemory, GuestMemoryBackend, GuestUsize, ReadVolatile,
};

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub use crate::loader_gen::bootparam;
Expand Down Expand Up @@ -219,7 +221,7 @@ unsafe impl ByteValued for bootparam::boot_params {}
/// let result = load_cmdline(&gm, GuestAddress(0x1000), &cl).unwrap();
/// gm.read_slice(buf.as_mut_slice(), GuestAddress(0x1000)).unwrap();
/// assert_eq!(buf.as_slice(), "foo=bar\0".as_bytes());
pub fn load_cmdline<M: GuestMemory>(
pub fn load_cmdline<M: GuestMemory + GuestMemoryBackend>(
guest_mem: &M,
guest_addr: GuestAddress,
cmdline: &Cmdline,
Expand Down