Skip to content

Commit 9db1c32

Browse files
committed
Merge branch 'main' into fix/value_validation
Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com>
2 parents def20c9 + eac7ec4 commit 9db1c32

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,11 @@ updates:
33
- package-ecosystem: gitsubmodule
44
directory: "/"
55
schedule:
6-
interval: monthly
6+
interval: weekly
7+
open-pull-requests-limit: 1
8+
- package-ecosystem: cargo
9+
directory: "/"
10+
schedule:
11+
interval: weekly
712
open-pull-requests-limit: 10
13+
rebase-strategy: "disabled"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Upcoming Release]
1+
# [v0.9.0]
22

33
## Fixed
44
- [[#71]](https://github.com/rust-vmm/linux-loader/issues/71) Fix incorrect

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "linux-loader"
3-
version = "0.8.1"
3+
version = "0.9.0"
44
authors = [
55
"The rust-vmm maintainers",
66
"rust-vmm AWS maintainers <rust-vmm-maintainers@amazon.com>",
@@ -22,11 +22,11 @@ elf = []
2222
pe = []
2323

2424
[dependencies]
25-
vm-memory = "0.10.0"
25+
vm-memory = "0.11.0"
2626

2727
[dev-dependencies]
2828
criterion = "0.3.5"
29-
vm-memory = { version = "0.10.0", features = ["backend-mmap"] }
29+
vm-memory = { version = "0.11.0", features = ["backend-mmap"] }
3030

3131
[[bench]]
3232
name = "main"

src/cmdline/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ fn valid_str(s: &str) -> Result<()> {
8686
}
8787

8888
fn is_quoted(s: &str) -> bool {
89-
if let Some(first_char) = s.chars().next() {
90-
if let Some(last_char) = s.chars().last() {
91-
return first_char == '"' && last_char == '"';
92-
}
89+
if s.matches("\"").count() != 2 {
90+
return false;
91+
}
92+
if let (Some(first_char), Some(last_char)) = (s.chars().next(), s.chars().last()) {
93+
return first_char == '"' && last_char == '"';
9394
}
9495
false
9596
}
@@ -591,6 +592,7 @@ mod tests {
591592
let mut cl = Cmdline::new(100).unwrap();
592593
assert_eq!(cl.insert("a ", "b"), Err(Error::HasSpace));
593594
assert_eq!(cl.insert("a", "b "), Err(Error::NoQuoteSpace));
595+
assert_eq!(cl.insert("a", "\" bbb\" asd \""), Err(Error::NoQuoteSpace));
594596
assert_eq!(cl.insert("a ", "b "), Err(Error::HasSpace));
595597
assert_eq!(cl.insert(" a", "b"), Err(Error::HasSpace));
596598
assert_eq!(cl.as_cstring().unwrap().as_bytes_with_nul(), b"\0");

src/loader/x86_64/elf/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl fmt::Display for Error {
104104

105105
impl std::error::Error for Error {}
106106

107-
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
107+
#[derive(Clone, Default, Copy, Debug, PartialEq, Eq)]
108108
/// Availability of PVH entry point in the kernel, which allows the VMM
109109
/// to use the PVH boot protocol to start guests.
110110
pub enum PvhBootCapability {
@@ -113,15 +113,10 @@ pub enum PvhBootCapability {
113113
/// PVH entry point is not present
114114
PvhEntryNotPresent,
115115
/// PVH entry point is ignored, even if available
116+
#[default]
116117
PvhEntryIgnored,
117118
}
118119

119-
impl Default for PvhBootCapability {
120-
fn default() -> Self {
121-
PvhBootCapability::PvhEntryIgnored
122-
}
123-
}
124-
125120
impl fmt::Display for PvhBootCapability {
126121
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
127122
use self::PvhBootCapability::*;

0 commit comments

Comments
 (0)