No description
Find a file
Daniel Verkamp 1ad9fcbab7 devices: virtio-fs: rework setattr Data::Handle enum
This previously held a raw descriptor (which is just an integer and does
not have an associated lifetime) and an Arc reference to its
corresponding HandleData in an attempt to ensure the HandleData did not
get destroyed while the RawDescriptor was alive. However, newer clippy
versions warn about the unused Arc<HandleDataField>, and this loose
association between the HandleData instance and the descriptor is prone
to being removed by accident since there is no actual lifetime.

To avoid this, keep only a MutexGuard<File> that refers to the file
inside the HandleData, and use a let binding to ensure that the Mutex
itself is alive for the remainder of the function (enforced with actual
Rust lifetimes rather than hopes and dreams).

BUG=b:344974550
TEST=tools/clippy

Change-Id: I4b1f66a2166422a87452fae597c3f08cbdc7dbe5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5623301
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2024-06-18 18:15:22 +00:00
.cargo Upgrade rust to 1.73.0 2024-02-20 19:11:51 +00:00
.config dev_container: Pass through NEXTEST_PROFILE 2023-12-14 19:01:30 +00:00
.devcontainer dev_container: Replace better toml extension 2023-07-27 23:37:15 +00:00
.github Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
.vscode Document feature flags and introduce new feature sets 2022-10-14 20:31:19 +00:00
aarch64 devices: vmwdt: Support PPI injection in detected vcpu stall 2024-06-12 09:40:09 +00:00
acpi_tables Cargo.toml: move tempfile to dev-dependencies 2024-05-07 20:00:48 +00:00
android_audio Implement virtio-snd aaudio stream to support audio in android 2024-05-31 05:32:38 +00:00
arch Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
argh_helpers Update to syn-2 2023-12-02 00:23:50 +00:00
audio_streams_conformance_test audio_streams_conformance_test: remove unused minijail dep 2024-05-22 21:24:02 +00:00
audio_util clippy: enforce safety block comments 2023-12-14 18:21:54 +00:00
base Windows clippy fixes for Rust 1.77 2024-06-13 01:07:13 +00:00
base_tokio Avoid clippy::blocks_in_conditions warnings 2024-06-11 00:18:47 +00:00
bit_field Reformat comments 2024-02-15 23:30:13 +00:00
broker_ipc metrics: Switch metrics from Tube to SendTube 2024-04-09 01:38:03 +00:00
common tree-wide: replace data_model::zerocopy_from_*() 2024-03-13 18:03:24 +00:00
cros_async cros_async: fix Windows test failures. 2024-06-13 21:49:24 +00:00
cros_fdt Fix clippy::assigning_clones lints 2024-06-10 19:33:36 +00:00
cros_tracing Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
cros_tracing_types Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
crosvm_cli devices: vfio: make global container state explicit 2024-06-06 23:31:16 +00:00
crosvm_control vm_control: fix more wildcard re-exports 2024-06-14 22:38:27 +00:00
crosvm_plugin Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
devices devices: virtio-fs: rework setattr Data::Handle enum 2024-06-18 18:15:22 +00:00
disk Fix clippy::suspicious_open_options warnings 2024-06-10 19:39:47 +00:00
docs/book cmdline: add root option for --pmem 2024-05-17 19:15:09 +00:00
e2e_tests e2e_tests: pmem: Add LIBNVDIMM config 2024-06-13 19:39:06 +00:00
ext2 crosvm: config: Make --pmem-ext2 Linux specific flag 2024-06-18 02:04:36 +00:00
fuse Avoid clippy::blocks_in_conditions warnings 2024-06-11 00:18:47 +00:00
fuzz Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
gpu_display gpu_display: android: rename ANativeWindow struct 2024-06-18 01:51:04 +00:00
hypervisor hypervisor: add test for hypervisor MMX state. 2024-06-18 17:54:39 +00:00
infra Roll recipe dependencies (trivial). 2024-06-17 19:09:51 +00:00
io_uring Fix clippy::suspicious_open_options warnings 2024-06-10 19:39:47 +00:00
jail Implement virtio-snd aaudio stream to support audio in android 2024-05-31 05:32:38 +00:00
kernel_cmdline Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
kernel_loader kernel_loader: simplify match of empty buf 2024-06-10 20:44:44 +00:00
kvm Fix clippy::thread_local_initializer_can_be_made_const 2024-06-10 20:07:13 +00:00
kvm_sys Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
libcras_stub Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
linux_input_sys Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
logo README: Use PNG logo image 2021-10-29 01:56:23 +00:00
media Rebuild testvm and devcontainer 2024-06-11 22:24:48 +00:00
metrics metrics: fix dead_code warning in test 2024-06-10 20:01:23 +00:00
metrics_events metric_events & src: add metric for VcpuShutdown. 2024-05-31 18:25:50 +00:00
net_sys Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
net_util Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
perfetto Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
power_monitor power_monitor: Filter out some power signals 2024-03-22 02:23:57 +00:00
prebuilts Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
proto_build_tools Cargo.toml: upgrade protobuf 2.x -> 3.x 2023-04-28 19:32:01 +00:00
protos clippy: enforce safety block comments 2023-12-14 18:21:54 +00:00
resources Fix clippy::unnecessary_get_then_check warnings 2024-06-10 20:01:30 +00:00
riscv64 aarch64, riscv64: fix max kernel command line length 2024-06-10 17:43:02 +00:00
rutabaga_gfx rutabaga_gfx: fix MinigbmBuffer dead_code warning 2024-06-14 21:11:53 +00:00
sandbox Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
serde_keyvalue Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
src crosvm: config: Make --pmem-ext2 Linux specific flag 2024-06-18 02:04:36 +00:00
swap swap: replace let-else with question mark operator 2024-06-10 19:30:30 +00:00
system_api devices: virtio-fs: enable dbus crate stdfd feature 2024-03-08 22:14:51 +00:00
tests Reformat comments 2024-02-15 23:30:13 +00:00
third_party vmm_vhost: fix clippy::option_map_or_err_ok 2024-06-10 19:50:12 +00:00
tools Rebuild testvm and devcontainer 2024-06-11 22:24:48 +00:00
tube_transporter Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
usb_sys clippy: enforce safety block comments 2023-12-14 18:21:54 +00:00
usb_util usb_util: fix clippy::unnecessary_get_then_check 2024-06-06 00:54:51 +00:00
vendor vendor/generic/metrics: document API methods. 2024-06-04 21:46:46 +00:00
vfio_sys bindgen: update to Linux 6.6 headers 2024-01-09 00:37:43 +00:00
vhost Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
virtio_sys devices: virtio: Support virtio suspend 2024-05-02 01:20:09 +00:00
vm_control vm_control: fix more wildcard re-exports 2024-06-14 22:38:27 +00:00
vm_memory vm_memory: remove unused .enumerate() 2024-06-10 20:03:35 +00:00
win_audio Windows clippy fixes for Rust 1.77 2024-06-13 01:07:13 +00:00
win_util Cargo.toml: avoid "*" versions for external crates 2024-05-22 01:01:42 +00:00
x86_64 x86_64: tests: remove unused TaggedControlTube 2024-06-17 17:21:36 +00:00
.dockerignore add docker supported builds and tests 2019-05-15 13:36:19 -07:00
.envrc Automatically register tools/ on PATH 2023-03-03 00:33:15 +00:00
.gitattributes config: force lf as line endings 2023-11-07 17:38:58 +00:00
.gitignore Automatically register tools/ on PATH 2023-03-03 00:33:15 +00:00
.gitmodules devices: remove --software-tpm support 2023-10-02 23:28:45 +00:00
.rustfmt.toml rustfmt: wrap comments 2024-02-15 23:30:13 +00:00
ARCHITECTURE.md docs: book: update architecture docs 2023-06-01 22:37:17 +00:00
Cargo.lock Support --pmem-ext2 option 2024-06-17 12:20:53 +00:00
Cargo.toml Support --pmem-ext2 option 2024-06-17 12:20:53 +00:00
CONTRIBUTING.md docs: update ChromeOS developer guide links 2024-03-21 17:41:27 +00:00
DIR_METADATA DIR_METADATA: Add public buganizer component 2022-09-21 17:43:59 +00:00
LICENSE Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
mypy.ini Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
OWNERS crosvm: add idanr@ to OWNERS 2024-05-31 00:11:01 +00:00
OWNERS_COUNCIL OWNERS_COUNCIL: Update council reviewers 2024-05-29 18:36:55 +00:00
PRESUBMIT.cfg Cleanup: Remove old, deprecated and no longer used files 2022-09-20 21:05:57 +00:00
pyproject.toml Add python configs for consistency between IDE and CI 2022-08-16 18:33:23 +00:00
README.chromeos.md crosvm: update book and doc links to crosvm.dev 2022-07-29 22:54:01 +00:00
README.md Fix remaining Chrome/Chromium OS instances 2023-01-03 22:14:30 +00:00
rust-toolchain Upgrade rust to 1.73.0 2024-02-20 19:11:51 +00:00

crosvm - The ChromeOS Virtual Machine Monitor

crosvm is a virtual machine monitor (VMM) based on Linuxs KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the ChromeOS platform. Compared to QEMU, crosvm doesnt emulate architectures or real hardware, instead concentrating on paravirtualized devices, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on ChromeOS devices.

Logo