zerocopy 0.7.x has finally released as a stable version, uprev it
to allow some remaining structs to be derivable.
TEST=CQ
BUG=b:300969352
FIXED=b:300969352
Change-Id: I90f0dfb09494f875fef1cd11bfcbd48030846092
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4878761
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
This feature does nothing in the base and devices crates, so remove it.
The remaining features enabled by chromeos are still needed until they
are enabled explicitly in the crosvm ebuild, so they aren't removed yet.
BUG=b:244618505
TEST=emerge-brya crosvm
Change-Id: I4fec40fb7ceb4eeff75266a66f19c0f142b9195a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4873792
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The software TPM backed by the libtpm2 simulator was only used for
testing; now that we have the vTPM proxy device, the software TPM is no
longer needed.
This also allows removal of the tpm2 submodule (tpm2-sys/libtpm2).
BUG=b:300673042
TEST=tools/dev_container tools/presubmit
Change-Id: I3feb5f715f9f12f832450df712c0f63ed7b4fb13
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4875221
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Previously all of the zerocopy imports just used "*", but there are
API changes in zerocopy 0.7, so ensure we get a compatible version by
depending on 0.6 everywhere.
This is a no-op since Cargo.lock already specifies a 0.6.x version, but
it will prevent accidentally upgrading to 0.7.x without updating to the
new API.
BUG=b:301283548
TEST=cargo build
Change-Id: Ifd702d982a09b5083dddd666dc6f3052cba22214
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4878502
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit just adds the feature but intentionally does not use it yet.
For downstream projects (e.g. the ChromeOS crosvm ebuild) that use
--no-default-features and enable individual features manually, those
projects will need to add the net feature to their build scripts in
order to keep network functionality. Once that is done, then we can make
the net feature actually control whether the net device is built.
Change-Id: I47e405ac295eef933f5d83ec3a4a490028da231b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4823132
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This code is unused and untested, while simultaneously making the rest
of the virtio device code more complex. Remove it.
BUG=b:276993009
TEST=tools/dev_container tools/presubmit
Change-Id: I9d44f92419c6912d1735043404d4f64efc95bba4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4676076
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
The newest chrono version is currently on the 0.4.x branch, but there
are preparations to release a 0.5.x version. Explicitly specify a 0.4.x
version in our dependencies since there will be backwards-incompatible
API breakages in 0.5.x.
<https://github.com/chronotope/chrono/issues/970>
The exact version chosen (chrono 0.4.19) matches the version we have
pinned in Cargo.lock currently and will match any newer 0.4.x releases,
so there should be no functional change.
BUG=None
TEST=cargo build
Change-Id: Ifa24a547e435ab4987be9358343e6b25c1385c66
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4774870
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
The cros-codecs API has changed a lot, and it supports zero-copy
decoding as well as HEVC now.
BUG=b:262824148
TEST=presubmit
Change-Id: Icc2a258642cef012b5640f1c71ccff481b5808f2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4744560
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
CL introduces HotPluggable, additional requirements for a PciDevice to
be configured in a hotplug context. VirtioPciDevice is currently the
only supported type.
TEST=tools/presubmit
BUG=b:243767476
Change-Id: I0e8a6c6fbd430216874b54d7b577f04cd4bae5fd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4615383
Reviewed-by: Chih-Yu Huang <akahuang@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
since the RegisteredEvent model is effectively an external API, switch
to using protobuf as a more formal/stable means of communicating
messages. also introduces exporting the registered_events.proto file as
part of crosvm_control build, alongside the currently existing header
file.
this patch also introduces feature-gating for registered_events and
protos so as not to bring in too many third party dependencies for a
base build.
BUG=b/278117550
TEST=run bzImage locally
TEST=sidecar program available at https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger-proto
Change-Id: I5d91d87f7807effc125352caf5c75eee2593f70d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4521604
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: maciek swiech <drmasquatch@google.com>
Use the version of cros-codecs publishes on crates.io and adapt the code
to be able to use it. This results in a few simplifications as e.g.
frame ordering is guaranteed by cros-codecs and we don't need to handle
it anymore.
BUG=b:262824148
TEST=ffmpeg -codec:v vp9_v4l2m2m -i Big_Buck_Bunny_720_10s_1MB.webm Big_Buck_Bunny-%03d.png
TEST=cargo test --features "video-decoder,vaapi,ffmpeg" -p devices -- --include-ignored test_decode_h264
Change-Id: Ib694afe8206a4d85b307efaaf3f6669dfe4e18bb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4518093
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Status does not depend on any swap related feature. Exposing Status to
all variants is easy to implement swap status FFI at crosvm_control.
The new "swap/enable" feature switches the actual vmm-swap functionality
to be compiled. The feature is enabled by default on "swap" crate but
disabled on the root package for test dependency.
Vmm-swap feature is enabled by `--features=swap` flag on cargo build as
before.
swap/src/controller.rs is copied from swap/src/lib.rs.
BUG=b:265386761
TEST=tools/dev_container tools/run_tests2
Change-Id: Ifc2539a62d0f594fd5bbb41623c735ea2621f7b6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4486546
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
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>
The vhost kernel API is specific to Linux; it doesn't make sense to
build it on Windows.
Change-Id: I3b8f726f74389f2a3ff78eff43b0c4f312382004
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4437030
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Since we're serializing `DateTime<Utc>` with `derive(Serialize)` in
cmos.rs, "serde" feature needs to be specified.
Even without this commit, `serde` feature was specified probably because
of indirect dependency. But, it'd be better to specify the feature
explicitly.
BUG=none
TEST=CQ
Change-Id: I637a804d93dab825cb4452d22e4b3882ac27cf98
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4414505
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Use NamedLock to prevent PassthroughFs tests from running in
multi-threads when one runs `cargo test`.
Previously, we ran these tests as a part of integration tests with
`libtest_mimic` to ensure it's not parallelized. But, using nextest's
feature is more straightforward. Also, running them as unit tests allow
us to call mocked functions with `#[cfg(test)]` in the future.
Note that NamedLock is not necessary for `cargo nextest` because it runs
each test single-threaded, but in multi-processes.
BUG=b:275016855
BUG=b:277302336
TEST=run_tests
Change-Id: I3751b712eaf1b2180bf4153ab501a32b402c0a29
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4406098
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Uprev to version available in Debian.
This seem to end up doing uprev to 1.3 now.
BUG=b:265082456
BUG=b:229895468
TEST=build
Change-Id: I550778acb675c9034b9cfcea77f4ae847e2d2ea1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4364559
Commit-Queue: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
We can't run PassthroughFS unit in multithreaded environment because each test creates its own PassthroughFS and the difference instances can execute conflicting process-wide operations (e.g. fchdir).
So, we need to have an integration test binary with a custom test
harness.
BUG=b:275016855
TEST=run_tests --dut=host
TEST=run_tests -p mingw64
Change-Id: I33855ab37bbe9486723038ed196f50a1a85ca748
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4369818
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
To support GenieZone (gz) hypervisor as a crosvm hypervisor backend:
- Implement GenieZone hypervisor
- Implement GenieZone’s irqchip
- Create config and feature for GenieZone
- Probe proper hypervisor backend with naive logic
- Inject virtual interrupts
- Bootup guest VM with linux kernel to shell
We still have other todos:
- Integrate with protected VM and pvmfw
- Support multi-core VM
Fixed bugs:
- Replace gz with geniezone in most cases for clarity
- Replace KVM’s ioctl number with GZVM’s ioctl in bindings
Bug: 264630327
TEST:
$ taskset 10 ./crosvm run --disable-sandbox -m 512 -s s1 \
--rwroot alpine-rootfs.img -p 'init=/bin/sh rodata=off' \
--display-window-keyboard Image_515_41_no_numa_20230130 \
--serial type=stdout,hardware=serial,earlycon \
--serial type=stdout,hardware=virtio-console,console,stdin
Change-Id: Ia5d92ba5cbb4198ab7f9f2a778da03b2199892cd
Signed-off-by: Ze-yu Wang <ze-yu.wang@mediatek.com>
Signed-off-by: Yi-de Wu <yi-de.wu@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4170415
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
File backend will write audio playback to files. Every PCM playback
stream will have its own file.
Changes:
* Add playback_path and playback_size to virtio::snd::Parameters
* Add new file_backend file in virtio::snd
* Add virtio-snd arg help.
BUG=b:233542268
TEST=run crosvm with --virtio-snd backend=file and call aplay
Change-Id: Iaec01f52292f1181b0137fa3c8d8c2b2b9e7cc49
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4306260
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Add a minijail's mode of operation where an always-allow seccomp
filter is attached to forked device processes. This facilitates
capturing seccomp filters used by each device process separately.
TESTED=./tools/build_release -- --features seccomp_trace && strace -ff crosvm --log-level debug run <args>
BUG=b:258316090
Change-Id: Ic4d3f5178e6a2dcbd748d101db43574f3224ff78
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4289510
Commit-Queue: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Thie effort is splitted into multiple CLs, to reduce change size
and also make bisecing breakages easier.
TESTED=CQ only
BUG=b:204409584
Change-Id: Ie90f171bd5f74b732df3129e94733f3b34621092
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4210751
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
This implements the equivalent logic on crosvm as
UFFD_FEATURE_EVENT_FORK. When each device process forks, the ProxyDevice
creates userfaultfd and send it to the monitor process by
SwapController::on_process_forked().
Crosvm does not have any child processes which may access the guest
memory except device processes as of now. Crosvm forks
virgl_render_server, but the mmap is not preserved in the process on
execve(2) since it is a different binary. Also no device process forks
grandchild processes according to the seccomp policy.
We actually can't use UFFD_FEATURE_EVENT_FORK because the feature does
not support non-root user namespace (go/uffd-fork-user-ns) and ARCVM
runs in a non-root user namespace.
This also adds syscalls to seccomp policies for devices to allow the
processes to create and setup a userfaultfd.
BUG=b:266641923
TEST=manually tested
Change-Id: Ide3088e1e95ae3c8259e3f4324124b3376e760b7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4194228
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This feature has nothing specific to Windows in its implementation, so
pull it up to the portable part of the Serial device.
The unit test is slightly modified to avoid the need for the regex
crate. This was the only use of regex in devices, so it can be dropped
from Cargo.toml.
BUG=None
TEST=cargo test -p devices serial
TEST=tools/run_tests --platform=mingw64
Change-Id: I3073e90d71bda3c9f6da1df3a3b657e62e087302
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4126251
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The PowerMonitor trait and the code monitoring it for events is not
platform specific, so it can be moved out of sys/unix into the main
battery code.
BUG=b:213149155
TEST=tools/presubmit --all
TEST=emerge-brya crosvm
Change-Id: I5c34c0e98009d866d5345fd940ecc7f742da1d2c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4122803
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
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>
If we always enable "slirp", then there are new, unwanted dependencies
on "libslirp-sys" and "pcap-file" in android.
The following line from the [features] section is sufficient to enable
it when needed:
slirp = ["net_util/slirp"]
BUG=b:260604615
TEST=cd devices; cargo test --target=x86_64-pc-windows-gnu --features=slirp
Change-Id: I87ff19a0101b9d09f42b11517bee2fef8b83ec3f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4082148
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Frederick Mayle <fmayle@google.com>
TEST=presubmits and this code works downstream
BUG=b:258298873
Change-Id: I7369fb08af474d107d056da8538de86bbc03eeb8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015562
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Richard Zhang <rizhang@google.com>
This is needed to build the `devices` crate only for the windows target.
BUG=none
TEST=cargo test --target=x86_64-pc-windows-gnu --features=slirp in devices
Change-Id: I781def962a716e4ee2ea80f3c6d1a426fc92e2e8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4028759
Reviewed-by: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Port the VAAPI backend to the new cros-codecs crate. This crate now
contains all codec related code and is independent from the rest of the
CrosVM code.
BUG=b:214478588
TEST="cargo test --package devices --lib --features video-decoder --features vaapi -- virtio::video::decoder::backend::vaapi::tests::test_get_capabilities --include-ignored"
Change-Id: Id207c53c0c4200e03ce8793d7c37cb5fbe808829
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3875044
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
libvda is only available on ChromeOS, and being unable to link to it
with regular builds reduces our build coverage.
Add a "libvda-stub" feature that, if enabled, results in dummy C stubs
being build for all the exported libvda functions. This allows builds
with the "libvda" feature to pass, although of course the resulting
video device would immediately crash and thus should not be used.
BUG=b:244619291
TEST=`cargo build --features="video-decoder,video-encoder,libvda-stub"`
completes.
TEST=`cargo build --features="video-decoder,video-encoder,libvda"`
reports link errors against libvda.
TEST=`cargo build --features all-x86_64` builds libvda and completes
without error.
Change-Id: I9bb60f6caf670081d67c91275727f3888272d64b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3947844
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Adds a new error code for when we fail to open a disk image. Also adds
an exit code we were missing upstream.
BUG=b:253348635
TEST=intentionally messed up the disk image path and verified we get
this error.
Change-Id: I197b4c5d80682dd1ee2a42d02df852276d204c17
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3961530
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Noah Gold <nkgold@google.com>
This replaces the handwritten arg parser with the serde_keyvalue
based parser. Eventually we will unify the arg parsing with Unix.
BUG=b:233676779
TEST=cargo b --features all-msvc64,gpu --no-default-features
TEST=cargo t -p vm_control --features all-msvc64,gpu
--no-default-features
TEST=cargo t -p crosvm sys::windows::config::
--features all-msvc64,gpu --no-default-features
Change-Id: I36a563be9767c7e5cbd3ab44f6a9ba23cd64cdb6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3939033
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
`tracing` conflicts with a crates.io crate. Since we may support tokio
tracing in the future, and want to submit some benchmarks against it
right now, we should rename our crate.
BUG=b:253517247
TEST=presubmit
Change-Id: I32bf64a7ce1830e881bd582e4606932782df65c6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3957598
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Adds a new message that can be used to map GPU memory via Vulkano.
BUG=b:244622199
TEST=presubmit & downstream
Change-Id: I4018cfda7573d4df2d89225060d5d61c8ac5d3d9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924935
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Idan Raiter <idanr@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
And enable it in upstream all-linux builds.
The feature is enabled for chromeos by default, so should
be a no-op for chromeos builds.
We can probably simplify the cfg() attributes further by
only enabling the feature for x86, so we do not need the
extra check each time. But that'll require ebuild changes.
BUG=b:244618505
TEST=presubmit
TEST=cargo build --no-default-features --features=vtpm
Change-Id: Ibb33c04ab5e6486969fefc6f3e57503be4eccdf3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3924741
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This allows us to enable the feature in upstream builds.
The feature is automatically enabled for the chromeos feature,
so it should be a noop for ChromeOS builds.
BUG=b:244618505
TEST=presubmit / build_packages implicit-system crosvm
Change-Id: I2ea2d668a0f8c2faa92aad5452df0bf660d85e0e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3919815
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
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>
We want to hide this variable from platforms that don't use it.
BUG=b:213149288
TEST=presubmit
Change-Id: I0d44d2bc50843b86d82b4084f95c8d1a1f750aa6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3895401
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Commit-Queue: Pujun Lun <lunpujun@google.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Chia-I Wu <olv@google.com>
We already depend on chrono elsewhere, so we might as well use it rather
than rolling our own unsafe wrapper around gmtime_r.
BUG=None
TEST=tools/presubmit --all
Change-Id: I46e4a75ca74f8a02875814f6cb21031db58e1e3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3795009
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Balloon support can not be compiled out, and don't need to be
disabled at run time.
BUG=b:235887451
TEST=Guest has balloon device by default, does not have balloon
device when disabled. Ballooning via cli functions by default,
return not supported when running vm has ballooning compiled out.
Change-Id: I737851496fe4c14cdbb69c48e6edf1ca9186c15a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3786928
Tested-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
This closes the deltas between some of the files of the crate. The
changes include
- Enables building/testing balloon module on windows.
- Suppressing dead-code warnings on windows in cross platform files.
- u16 to enum fix.
- Organizing imports.
- Using Descriptor(windows friendly) over RawDescriptor.
- Using Option<Tube> instead of Tube.
- Fix some args parsing on windows.
BUG=213149155
TEST=presubmit and built on windows downstream
Change-Id: Idd2ee81384bc5fade610aa864b2c712ea0a0e0d2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3783010
Tested-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
This adds a sync thread that will call `fsync` once a second. This is a
safety measure since Window OS handles flushing automatically, but has been
proven to be somewhat unreliable.
TEST=built and presubmits
BUG=b:233951530
Change-Id: I7f5922da09fd95999bf8a7a40abc3b6ae796eafc
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764466
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: Richard Zhang <rizhang@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Add a VAAPI video decoder backend. This backend is able to decode frames
by calling into the VAAPI driver in the system. It does so by making use
of a libva wrapper crate that exposes a subset of the VA C code in safe
Rust.
BUG=b:214478588
TEST=virtio::video::decoder::backend::vaapi::tests::test_get_capabilities
passes on Hatch.
Change-Id: I52ac6b5b915d9c3a9b55381e1076c1b5ac0dfb5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3514624
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commented out code reference sandbox crate, which still needs to be
upstreamed
Still need to enable:
* balloon (try_clone not implemented)
* console (Need to enable Serial)
* snd (Unix code not conditionally compiled out)
* gpu (Waiting for graphics team to upstream)
BUG=b:237011316
TEST=ran "./tools/run_tests --target=host --arch=win64 --verbose"
Change-Id: I1b5f7ae575365351184042bc65cffcfd7efe999a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3721870
Reviewed-by: Noah Gold <nkgold@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>