mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2025-02-05 18:20:34 +00:00
7b13ef3ea6
Based on the previous proposal in [1]. * The Executor is now completely platform-agnostic and only relies on the platform to provide a type that implements the `PlatformState` trait. * The crate provides concrete high-level types rather than forcing users to deal with trait objects and async-trait. Currently, only File and Event are supported. Support for timers, sockets, and pipes will be added in subsequent changes. * Each high-level type delegates the implementation to a platform-specific type and exists mainly as a place to hold documentation and tests. * On Unix the io_driver module provides async versions of various IO-related syscalls, which are used by the platform-specific File and Event types to implement the required behavior. * io-uring support can be disabled at compile time. When uring support is enabled, we make a runtime check to decide whether or not to use it. The actual io-uring driver is currently unimplemented and will be added in a subsequent change. One non-trivial downside of this change is that the futures returned by the various async methods are !Send and !Sync, which means that they can only be awaited from the same thread on which they were started. In practice this should be fine since current crosvm (and Chrome OS) code doesn't really make use of sending futures to different threads. This can also be mitigated by using `Executor::spawn_local` and a `oneshot::channel` to isolate the !Send future from the outer async fn (as long as the output of the future is Send). See the crate documentation and the `outer_future_is_send` test in `src/executor.rs` for more details. [1]: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3062166 BUG=b:195468578 TEST=unit tests Change-Id: I1aad0885e67a957149e2ec3b4d9df215d9b20d81 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3222223 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Chirantan Ekbote <chirantan@chromium.org>
178 lines
4.8 KiB
TOML
178 lines
4.8 KiB
TOML
[package]
|
|
name = "crosvm"
|
|
version = "0.1.0"
|
|
authors = ["The Chromium OS Authors"]
|
|
edition = "2018"
|
|
default-run = "crosvm"
|
|
|
|
[lib]
|
|
path = "src/crosvm.rs"
|
|
|
|
[[bin]]
|
|
name = "crosvm"
|
|
path = "src/main.rs"
|
|
|
|
[[bin]]
|
|
name = "crosvm-direct"
|
|
path = "src/main.rs"
|
|
required-features = [ "direct" ]
|
|
|
|
[profile.release]
|
|
panic = 'abort'
|
|
overflow-checks = true
|
|
|
|
# We currently need to exclude some crates from the workspace to allow
|
|
# these crates to be independently built by portage. These crates will
|
|
# eventually be moved into separate repositories.
|
|
# The only workspace members that need to be explicitly specified here are those
|
|
# that are not dependencies of the crosvm root crate.
|
|
[workspace]
|
|
members = [
|
|
"aarch64",
|
|
"acpi_tables",
|
|
"arch",
|
|
"bit_field",
|
|
"crosvm-fuzz",
|
|
"crosvm_plugin",
|
|
"devices",
|
|
"disk",
|
|
"fuse",
|
|
"gpu_display",
|
|
"hypervisor",
|
|
"integration_tests",
|
|
"kernel_cmdline",
|
|
"kernel_loader",
|
|
"kvm",
|
|
"kvm_sys",
|
|
"libcrosvm_control",
|
|
"libvda",
|
|
"linux_input_sys",
|
|
"net_sys",
|
|
"net_util",
|
|
"power_monitor",
|
|
"protos",
|
|
"qcow_utils",
|
|
"resources",
|
|
"rutabaga_gfx",
|
|
"rutabaga_gfx/ffi",
|
|
"tpm2",
|
|
"tpm2-sys",
|
|
"usb_sys",
|
|
"usb_util",
|
|
"vfio_sys",
|
|
"vhost",
|
|
"virtio_sys",
|
|
"vm_control",
|
|
"vm_memory",
|
|
"third_party/vmm_vhost",
|
|
"x86_64",
|
|
]
|
|
exclude = [
|
|
"common/assertions",
|
|
"common/audio_streams",
|
|
"common/base",
|
|
"common/cros-fuzz",
|
|
"common/cros_async",
|
|
"common/cros_asyncv2",
|
|
"common/data_model",
|
|
"common/io_uring",
|
|
"common/p9",
|
|
"common/sync",
|
|
"common/sys_util",
|
|
]
|
|
|
|
[features]
|
|
all-linux = [
|
|
# TODO(b/203105868): Enable remaining features on linux builds.
|
|
"composite-disk",
|
|
"default",
|
|
"gdb",
|
|
"tpm",
|
|
"virgl_renderer_next",
|
|
"virgl_renderer",
|
|
"x",
|
|
]
|
|
audio = ["devices/audio"]
|
|
audio_cras = ["devices/audio_cras"]
|
|
chromeos = ["base/chromeos", "audio_cras", "devices/chromeos"]
|
|
composite-disk = ["protos/composite-disk", "protobuf", "disk/composite-disk"]
|
|
default = ["audio", "gpu", "usb"]
|
|
default-no-sandbox = []
|
|
direct = ["devices/direct"]
|
|
gdb = ["gdbstub", "gdbstub_arch", "arch/gdb", "vm_control/gdb", "x86_64/gdb"]
|
|
gfxstream = ["devices/gfxstream"]
|
|
gpu = ["devices/gpu"]
|
|
libvda = ["devices/libvda"]
|
|
plugin = ["protos/plugin", "crosvm_plugin", "kvm", "kvm_sys", "protobuf"]
|
|
power-monitor-powerd = ["arch/power-monitor-powerd"]
|
|
tpm = ["devices/tpm"]
|
|
usb = ["devices/usb"]
|
|
video-decoder = ["devices/video-decoder", "libvda"]
|
|
video-encoder = ["devices/video-encoder", "libvda"]
|
|
virgl_renderer = ["devices/virgl_renderer"]
|
|
virgl_renderer_next = ["rutabaga_gfx/virgl_renderer_next"]
|
|
wl-dmabuf = ["devices/minigbm"]
|
|
x = ["devices/x"]
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.32"
|
|
arch = { path = "arch" }
|
|
assertions = { path = "common/assertions" }
|
|
audio_streams = "*"
|
|
base = "*"
|
|
bit_field = { path = "bit_field" }
|
|
crosvm_plugin = { path = "crosvm_plugin", optional = true }
|
|
data_model = "*"
|
|
devices = { path = "devices" }
|
|
disk = { path = "disk" }
|
|
enumn = "0.1.0"
|
|
gdbstub = { version = "0.5.0", optional = true }
|
|
gdbstub_arch = { version = "0.1.0", optional = true }
|
|
rutabaga_gfx = { path = "rutabaga_gfx"}
|
|
hypervisor = { path = "hypervisor" }
|
|
kernel_cmdline = { path = "kernel_cmdline" }
|
|
kernel_loader = { path = "kernel_loader" }
|
|
kvm = { path = "kvm", optional = true }
|
|
kvm_sys = { path = "kvm_sys", optional = true }
|
|
libc = "0.2.93"
|
|
libcras = "*"
|
|
minijail = "*" # provided by ebuild
|
|
net_util = { path = "net_util" }
|
|
p9 = "*"
|
|
protobuf = { version = "2.3", optional = true }
|
|
protos = { path = "protos", optional = true }
|
|
remain = "*"
|
|
resources = { path = "resources" }
|
|
serde_json = "*"
|
|
sync = { path = "common/sync" }
|
|
tempfile = "3"
|
|
thiserror = { version = "1.0.20" }
|
|
vhost = { path = "vhost" }
|
|
vm_control = { path = "vm_control" }
|
|
acpi_tables = { path = "acpi_tables" }
|
|
vm_memory = { path = "vm_memory" }
|
|
|
|
[target.'cfg(target_arch = "x86_64")'.dependencies]
|
|
x86_64 = { path = "x86_64" }
|
|
|
|
[target.'cfg(any(target_arch = "aarch64", target_arch = "arm"))'.dependencies]
|
|
aarch64 = { path = "aarch64" }
|
|
|
|
[dev-dependencies]
|
|
base = "*"
|
|
|
|
[patch.crates-io]
|
|
assertions = { path = "common/assertions" }
|
|
audio_streams = { path = "common/audio_streams" }
|
|
base = { path = "common/base" }
|
|
cros_async = { path = "common/cros_async" }
|
|
cros_asyncv2 = { package = "cros_async", path = "common/cros_asyncv2" }
|
|
cros_fuzz = { path = "common/cros-fuzz" } # ignored by ebuild
|
|
data_model = { path = "common/data_model" }
|
|
libcras = { path = "libcras_stub" } # ignored by ebuild
|
|
p9 = { path = "common/p9" } # ignored by ebuild
|
|
sync = { path = "common/sync" }
|
|
sys_util = { path = "common/sys_util" }
|
|
system_api = { path = "system_api_stub" } # ignored by ebuild
|
|
wire_format_derive = { path = "common/p9/wire_format_derive" } # ignored by ebuild
|
|
minijail = { path = "third_party/minijail/rust/minijail" } # ignored by ebuild
|