diff --git a/Cargo.toml b/Cargo.toml index f3e0993..a60ffb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,5 @@ version = "0.1.0" edition = "2021" [dependencies] -clap = "3.0.0-beta.5" +clap = {version = "4.1.4", features = ["derive"]} vmm = { path = "src/vmm" } \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index fc88f3d..b372a8e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,8 +19,8 @@ struct VMMOpts { memory: u32, /// A level of verbosity, and can be used multiple times - #[clap(short, long, parse(from_occurrences))] - verbose: i32, + #[clap(short, long, action=clap::ArgAction::Count )] + verbose: u8, /// Stdout console file path #[clap(long)] diff --git a/src/vmm/Cargo.toml b/src/vmm/Cargo.toml index 502ea50..ecc1f6b 100644 --- a/src/vmm/Cargo.toml +++ b/src/vmm/Cargo.toml @@ -5,12 +5,12 @@ edition = "2018" [dependencies] epoll = "4.3.1" -kvm-bindings = { version = "0.5.0", features = ["fam-wrappers"] } -kvm-ioctls = "0.11.0" +kvm-bindings = { version = "0.6.0", features = ["fam-wrappers"] } +kvm-ioctls = "0.13.0" libc = "0.2.91" -linux-loader = { version = "0.4.0", features = ["bzimage", "elf"] } -vm-memory = { version = "0.7.0", features = ["backend-mmap"] } -vmm-sys-util = "0.9.0" +linux-loader = { version = "0.8.1", features = ["bzimage", "elf"] } +vm-memory = { version = "0.10.0", features = ["backend-mmap"] } +vmm-sys-util = "0.11.1" # vm-device is not yet published on crates.io. # To make sure that breaking changes to vm-device are not breaking the @@ -18,3 +18,6 @@ vmm-sys-util = "0.9.0" vm-device = { git = "https://github.com/rust-vmm/vm-device", rev = "5847f12" } vm-superio = "0.4.0" +serial-line-ip = "0.5.0" +serde_json = "1.0.94" +serde = { version = "1.0.126", features = ["derive"] } \ No newline at end of file diff --git a/src/vmm/src/kernel.rs b/src/vmm/src/kernel.rs index b523fad..43e407b 100644 --- a/src/vmm/src/kernel.rs +++ b/src/vmm/src/kernel.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause - #![cfg(target_arch = "x86_64")] use std::fs::File; @@ -130,7 +128,8 @@ pub fn kernel_setup( bootparams.hdr.cmdline_size = CMDLINE.len() as u32 + 1; // Load the kernel command line into guest memory. - let mut cmdline = Cmdline::new(CMDLINE.len() + 1); + let mut cmdline = Cmdline::new(CMDLINE.len() + 1).map_err(Error::Cmdline)?; + cmdline.insert_str(CMDLINE).map_err(Error::Cmdline)?; load_cmdline( guest_memory,