Skip to content

Commit 1b200f4

Browse files
committed
chore(deps): bump vm-memory version
Bump maximum vm-memory version to 0.18.0, and disable default features that depend on rawfd. Signed-off-by: Theo Paris <theo@theoparis.com>
1 parent 4fb56c1 commit 1b200f4

File tree

6 files changed

+16
-15
lines changed

6 files changed

+16
-15
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ pe = ["elf"]
2626
elf = []
2727

2828
[dependencies]
29-
vm-memory = ">=0.16.0, <=0.17.1"
29+
vm-memory = { version = "0.18.0" }
3030

3131
[dev-dependencies]
32-
criterion = { version = "0.7.0", features = ["html_reports"] }
33-
vm-memory = { version = ">=0.16.0, <=0.17.1", features = ["backend-mmap"] }
32+
criterion = { version = "0.8.1", features = ["html_reports"] }
33+
vm-memory = { version = "0.18.0", features = ["backend-mmap"] }
3434

3535
[[bench]]
3636
name = "main"

src/configurator/fdt.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
44

55
//! Traits and structs for loading the device tree.
6-
7-
use vm_memory::{Bytes, GuestMemory};
6+
use vm_memory::{Bytes, GuestMemory, GuestMemoryBackend};
87

98
use std::fmt;
109

@@ -56,7 +55,7 @@ impl BootConfigurator for FdtBootConfigurator {
5655
/// # extern crate vm_memory;
5756
/// # use linux_loader::configurator::{BootConfigurator, BootParams};
5857
/// # use linux_loader::configurator::fdt::FdtBootConfigurator;
59-
/// # use vm_memory::{Address, ByteValued, GuestMemory, GuestMemoryMmap, GuestAddress};
58+
/// # use vm_memory::{Address, ByteValued, GuestMemory, GuestMemoryBackend, GuestMemoryMmap, GuestAddress};
6059
/// # #[derive(Clone, Copy, Default)]
6160
/// # struct FdtPlaceholder([u8; 0x20]);
6261
/// # unsafe impl ByteValued for FdtPlaceholder {}
@@ -79,7 +78,7 @@ impl BootConfigurator for FdtBootConfigurator {
7978
/// ```
8079
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
8180
where
82-
M: GuestMemory,
81+
M: GuestMemory + GuestMemoryBackend,
8382
{
8483
guest_memory
8584
.checked_offset(params.header_start, params.header.len())

src/configurator/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
#![cfg(any(feature = "elf", feature = "pe", feature = "bzimage"))]
2020

21-
use vm_memory::{Address, ByteValued, GuestAddress, GuestMemory};
21+
use vm_memory::{Address, ByteValued, GuestAddress, GuestMemory, GuestMemoryBackend};
2222

2323
use std::fmt;
2424

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

129129
/// Boot parameters to be written in guest memory.

src/configurator/x86_64/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! Traits and structs for configuring and loading boot parameters on `x86_64` using the Linux
1313
//! boot protocol.
1414
15-
use vm_memory::{Bytes, GuestMemory};
15+
use vm_memory::{Bytes, GuestMemory, GuestMemoryBackend};
1616

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

@@ -97,7 +97,7 @@ impl BootConfigurator for LinuxBootConfigurator {
9797
/// [`boot_params`]: ../loader/bootparam/struct.boot_params.html
9898
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
9999
where
100-
M: GuestMemory,
100+
M: GuestMemory + GuestMemoryBackend,
101101
{
102102
// The VMM has filled a `boot_params` struct and its e820 map.
103103
// This will be written in guest memory at the zero page.

src/configurator/x86_64/pvh.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
#![cfg(any(feature = "elf", feature = "bzimage"))]
1616

17-
use vm_memory::{ByteValued, Bytes, GuestMemory};
17+
use vm_memory::{ByteValued, Bytes, GuestMemory, GuestMemoryBackend};
1818

1919
use crate::configurator::{BootConfigurator, BootParams, Error as BootConfiguratorError, Result};
2020
use crate::loader_gen::start_info::{hvm_memmap_table_entry, hvm_modlist_entry, hvm_start_info};
@@ -145,7 +145,7 @@ impl BootConfigurator for PvhBootConfigurator {
145145
/// ```
146146
fn write_bootparams<M>(params: &BootParams, guest_memory: &M) -> Result<()>
147147
where
148-
M: GuestMemory,
148+
M: GuestMemory + GuestMemoryBackend,
149149
{
150150
// The VMM has filled an `hvm_start_info` struct and a `Vec<hvm_memmap_table_entry>`
151151
// and has passed them on to this function.

src/loader/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ use std::io::{Read, Seek};
2424

2525
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
2626
use vm_memory::ByteValued;
27-
use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestUsize, ReadVolatile};
27+
use vm_memory::{
28+
Address, Bytes, GuestAddress, GuestMemory, GuestMemoryBackend, GuestUsize, ReadVolatile,
29+
};
2830

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

0 commit comments

Comments
 (0)