crosvm: migrate to Rust 2021 edition

BUG=none
TEST=cq

Change-Id: I0059c970879b78bfd40b6ce58b10debcf154b50f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3508322
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Anton Romanov <romanton@google.com>
This commit is contained in:
Anton Romanov 2022-03-08 01:16:09 +00:00 committed by Commit Bot
parent 6fd8926373
commit bed40ad547
59 changed files with 63 additions and 70 deletions

View file

@ -2,7 +2,7 @@
name = "crosvm"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
default-run = "crosvm"
[lib]

View file

@ -2,7 +2,7 @@
name = "aarch64"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
arch = { path = "../arch" }

View file

@ -2,7 +2,7 @@
name = "acpi_tables"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../common/data_model" }

View file

@ -2,7 +2,7 @@
name = "arch"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
power-monitor-powerd = ["power_monitor/powerd"]

View file

@ -2,7 +2,7 @@
name = "bit_field"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
bit_field_derive = { path = "bit_field_derive" }

View file

@ -2,7 +2,7 @@
name = "bit_field_derive"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
proc-macro2 = "^1"

View file

@ -2,7 +2,7 @@
name = "assertions"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[workspace]

View file

@ -2,7 +2,7 @@
name = "audio_streams"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/audio_streams.rs"

View file

@ -2,7 +2,7 @@
name = "balloon_control"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
serde = { version = "1", features = [ "derive" ] }

View file

@ -2,7 +2,7 @@
name = "base"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
chromeos = ["sys_util/chromeos"]

View file

@ -2,7 +2,7 @@
name = "cros_fuzz"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["Cargo.toml", "src/*.rs"]
[dependencies]

View file

@ -2,7 +2,7 @@
name = "cros_async"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
async-trait = "0.1.36"

View file

@ -1,7 +1,7 @@
[package]
name = "cros_async"
version = "0.2.0"
edition = "2018"
edition = "2021"
[features]
uring = ["io-uring"]

View file

@ -2,7 +2,7 @@
name = "data_model"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[dependencies]

View file

@ -2,7 +2,7 @@
name = "io_uring"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../data_model" } # provided by ebuild

View file

@ -2,7 +2,7 @@
name = "p9"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
libc = "*"

View file

@ -2,7 +2,7 @@
name = "p9-fuzz"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
p9 = { path = "../" }

View file

@ -2,7 +2,7 @@
name = "sync"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[workspace]

View file

@ -2,7 +2,7 @@
name = "sys_util"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[dependencies]

View file

@ -549,19 +549,12 @@ unsafe impl<T> Killable for JoinHandle<T> {
/// Treat some errno's as Ok(()).
macro_rules! ok_if {
($result:expr, $($errno:pat)|+) => {{
let res = $result;
match res {
Ok(_) => Ok(()),
Err(err) => {
if matches!(err.errno(), $($errno)|+) {
Ok(())
} else {
Err(err)
}
($result:expr, $errno:pat) => {{
match $result {
Err(err) if !matches!(err.errno(), $errno) => Err(err),
_ => Ok(()),
}
}
}}
}};
}
/// Terminates and reaps a child process. If the child process is a group leader, its children will

View file

@ -2,7 +2,7 @@
name = "sys_util_core"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[dependencies]

View file

@ -2,7 +2,7 @@
name = "poll_token_derive"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["*.rs", "Cargo.toml"]
[lib]

View file

@ -2,7 +2,7 @@
name = "crosvm-fuzz"
version = "0.0.1"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
cros_fuzz = "*"

View file

@ -2,7 +2,7 @@
name = "crosvm_control"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
crate-type = ["cdylib"]

View file

@ -2,7 +2,7 @@
name = "crosvm_plugin"
version = "0.17.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
stats = []

View file

@ -2,7 +2,7 @@
name = "devices"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
audio = []

View file

@ -2,7 +2,7 @@
name = "disk"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/disk.rs"

View file

@ -2,7 +2,7 @@
name = "fuse"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/lib.rs"

View file

@ -2,7 +2,7 @@
name = "gpu_display"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
x = []

View file

@ -2,7 +2,7 @@
name = "hypervisor"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
bit_field = { path = "../bit_field" }

View file

@ -2,7 +2,7 @@
name = "integration_tests"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dev-dependencies]
tempfile = "3"

View file

@ -1,7 +1,7 @@
[package]
name = "kernel_cmdline"
version = "0.1.0"
edition = "2018"
edition = "2021"
[dependencies]
libc = "*"

View file

@ -1,7 +1,7 @@
[package]
name = "kernel_loader"
version = "0.1.0"
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../common/data_model" }

View file

@ -2,7 +2,7 @@
name = "kvm"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../common/data_model" }

View file

@ -2,7 +2,7 @@
name = "kvm_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../common/data_model" }

View file

@ -2,7 +2,7 @@
name = "libcras"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/libcras.rs"

View file

@ -2,7 +2,7 @@
name = "libvda"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
links = "vda"
[dependencies]

View file

@ -2,7 +2,7 @@
name = "linux_input_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../common/data_model" }

View file

@ -2,7 +2,7 @@
name = "net_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
base = { path = "../common/base" }

View file

@ -2,7 +2,7 @@
name = "net_util"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
libc = "*"

View file

@ -2,7 +2,7 @@
name = "power_monitor"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
powerd = ["dbus", "protobuf", "protoc-rust"]

View file

@ -2,7 +2,7 @@
name = "protos"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
plugin = ["kvm_sys"]

View file

@ -2,7 +2,7 @@
name = "qcow_utils"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/qcow_utils.rs"

View file

@ -2,7 +2,7 @@
name = "resources"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
libc = "*"

View file

@ -2,7 +2,7 @@
name = "rutabaga_gfx"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
gfxstream = []

View file

@ -2,7 +2,7 @@
name = "rutabaga_gfx_ffi"
version = "0.1.0"
authors = ["The Chromium OS Authors + Android Open Source Project"]
edition = "2018"
edition = "2021"
[lib]
name = "rutabaga_gfx_ffi"

View file

@ -2,7 +2,7 @@
name = "gpu_buffer"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
data_model = { path = "../data_model" }

View file

@ -2,7 +2,7 @@
name = "system_api"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[lib]
path = "src/system_api.rs"

View file

@ -8,7 +8,7 @@ repository = "https://github.com/rust-vmm/vhost"
documentation = "https://docs.rs/vhost"
readme = "README.md"
license = "Apache-2.0 or BSD-3-Clause"
edition = "2018"
edition = "2021"
[features]
default = []

View file

@ -2,7 +2,7 @@
name = "tpm2-sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
links = "tpm2"
[build-dependencies]

View file

@ -2,7 +2,7 @@
name = "tpm2"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
tpm2-sys = { path = "../tpm2-sys" }

View file

@ -2,7 +2,7 @@
name = "usb_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
base = { path = "../common/base" }

View file

@ -2,7 +2,7 @@
name = "usb_util"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
assertions = { path = "../common/assertions" }

View file

@ -2,7 +2,7 @@
name = "vfio_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
base = { path = "../common/base" }

View file

@ -2,7 +2,7 @@
name = "vhost"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
assertions = { path = "../common/assertions" }

View file

@ -2,7 +2,7 @@
name = "virtio_sys"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[dependencies]
base = { path = "../common/base" }

View file

@ -2,7 +2,7 @@
name = "vm_control"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
gdb = ["gdbstub_arch"]

View file

@ -2,7 +2,7 @@
name = "vm_memory"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
include = ["src/**/*", "Cargo.toml"]
[dependencies]

View file

@ -2,7 +2,7 @@
name = "x86_64"
version = "0.1.0"
authors = ["The Chromium OS Authors"]
edition = "2018"
edition = "2021"
[features]
gdb = ["gdbstub_arch", "arch/gdb"]