Commit graph

8 commits

Author SHA1 Message Date
Daniel Verkamp
fa159ee24a devices: virtio-fs: enable dbus crate stdfd feature
"stdfd" replaces the dbus::arg::OwnedFd type with the OwnedFd from the
standard library (std::os::fd::OwnedFd), which allows safe conversion.

Also use SafeDescriptor::try_from() to clone the descriptor rather than
base::clone_descriptor(), which returns an unmanaged RawDescriptor.

BUG=b:327639547

Change-Id: Ifa1e6b783217e946c027e4db9a6202b39c92936e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5354030
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2024-03-08 22:14:51 +00:00
A. Cody Schuffelen
97dff044f8 Replace #[cfg(unix)] with #[cfg(any(target_os = "android", target_os = "linux"))]
Updates are made to source and documentation.

This more accurately represents the currently supported platforms of
Android/Linux and Windows, without unexpectedly including other
unix-like operating systems.

Command to reproduce:
$ find . -type f -not -path '*/\.git/*' | xargs -I {} sed -i 's/cfg(unix)/cfg(any(target_os = "android", target_os = "linux"))/g' {}
$ cargo fmt

md files manually updated to fix line lengths.

Renaming `unix` modules to `linux` will be done in a later CL.

Test: ./tools/dev_container ./tools/presubmit
Bug: b/298269162
Change-Id: I42c1bf0abf80b9a0df25551613910293217c7295
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4909059
Commit-Queue: Cody Schuffelen <schuffelen@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-10-11 00:43:29 +00:00
Momoko Hattori
fe5be7e78d system_api: Remove UserDataAuth
After CL:4712775, crosvm doesn't call UserDataAuth's D-Bus methods. This
CL hence removes Rust interface of UserDataAuth's D-Bus method and proto
definitions used by UserDataAuth.

BUG=b:229122701
TEST=./update_bindings.sh
TEST=emerge-<BOARD> crosvm

Change-Id: Idc79b07614a50bd17ff99c124e501a88eeda2c1b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4776924
Commit-Queue: Momoko Hattori <momohatt@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-08-15 11:08:04 +00:00
Momoko Hattori
d968c4f178 system_api: Add spaced D-Bus bindings and update other bindings
This CL adds spaced D-Bus bindings, which will be used in a follow-up
CL. Also updates other bindings as a result of running
update_bindings.sh.

BUG=b:229122701
TEST=./update_bindings.sh
TEST=emerge-<BOARD> crosvm

Change-Id: I363272b223d399e82873fb6697f54742cebb874b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4712774
Commit-Queue: Momoko Hattori <momohatt@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
2023-08-05 04:06:09 +00:00
Daniel Verkamp
a360baa819 Cargo.toml: upgrade protobuf 2.x -> 3.x
system_api bindings have been regenerated with protobuf 3.2; this should
be okay to land before the full ChromeOS system_api migration, since
crosvm always uses its own copy of the bindings rather than the ones
provided by the dev-rust/system_api package.

The protoc-rust crate is replaced with protobuf_codegen in 3.x.

BUG=b:277243607
BUG=b:279834784
TEST=tools/dev_container tools/presubmit

Change-Id: I6aad45ded2639d7506a7238800584bebab196455
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4405309
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
2023-04-28 19:32:01 +00:00
Daniel Verkamp
ac0fc378a3 Fix remaining Chrome/Chromium OS instances
These should be written as ChromeOS and ChromiumOS (without the space)
to match the updated branding. The copyright headers were already
migrated to the new style (https://crrev.com/c/3894243), but there were
some more instances left over.

BUG=None
TEST=tools/cargo-doc

Change-Id: I8c76aea2eb33b2e370ab71ee9b5cc0a4cfd00585
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4129934
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2023-01-03 22:14:30 +00:00
Dennis Kempin
ee15178af7 Fix compilation with vtpm enabled
This snuck through because it's only compiled for chromeos. The feature
will be split out and enabled on upstream builds in https://crrev.com/c/3924741
to prevent failures like this in the future.

BUG=None
TEST=emerge-amd64-generic implicit-system crosvm

Change-Id: Id74c59a5a5a765bfbe5864ee9588ab9863b18bc7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3929079
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
2022-09-29 17:17:21 +00:00
Dennis Kempin
891455563b system_api: Add copy of ChromeOS's system_api
Adds a script that copies the bindings we need upstream. We cannot
use the original repository, as it's part of the large platform2 git
repository, and the original build.rs depends on ChromeOS tooling to
generate these bindings.

So instead, this change adds a script that can be called from a
chromiumos checkout of crosvm to update the upstream bindings.

This allows us to enable certain features that talk to ChromeOS
dbus services. They won't be functional upstream, but at least we
can compile and test the code.

To make things more consistent, we no longer replace the crate
with the ChromeOS version when building for ChromeOS.

BUG=b:244618505
TEST=presubmit

Change-Id: I504cbf6d12b0cb50d9935f5e49b7fa72b692d45c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3919814
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2022-09-28 18:13:00 +00:00