Error descriptions should have no leading capital and do not end with a
dot.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I807e4874c862bc8e32dc4a394b1e5e46df60c8d0
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005489
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
These types are only used in two places, and their actual definition is
more explicit about their purpose.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I90eec9751bc4aaccab33fe70d96a94a5875f6f6c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3995769
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The DynDecodedHandle traits defined for each codec are basically
identical, and can be simplified into a single one now that we also have
a common DecodedHandle struct.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I666d941dfea5b5e40ca46dab661e87aec60d65e4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998376
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The DecodedHandle structs defined for each codec are basically identical
and can be simplified into a single one by adding an associated type.
Doing so required the H.264 types to be constrained with non-trivial
where clauses due to the fact the H264 PictureData is itself generic,
but there is a plan to simplify this too.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: Idcb0717740e6e700ae83d758f99ba0035981dcca
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998375
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
SurfaceContainer was implemented for each codec type, but it can be
simplified into a single generic implementation if move the RefCell out
of InnerHandle.
Since SurfaceContainer's purpose is just to convert one object into a
Surface, rename it into the more idiomatic IntoSurface that just
requires TryInto<Option<Surface>>.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I00a56132ceaeab5d305e144976a9ea597355bbf8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998374
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The Picture structs defined for each codec are now basically identical,
and can be simplified into a single one by adding one generic argument.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs:wq
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I48a79c615f7c53de5d39bcf37da0b64d05c65a09
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998373
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
The Picture structs defined for each codec are essentially identical,
with only the H.264 one having its codec-specific data inlined into the
struct instead of being part of another one. Move the H.264 data in
order to make the 3 structures similar. This will allow us to merge them
into one common struct in the next CL.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I3282fde1dbbc2ad303f2691e00c46aa8b6c0de41
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998372
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.corp-partner.google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
backend_handle_unchecked* were only used in tests, and the DynPicture
interface provides equivalent functions anyway, so use these ones and
drop the former.
Ideally these methods that can potentially panic should be replaced by
something else, but this will have to wait further cleanups.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
TEST=`cros-codecs --include-ignored` passes on hatch.
Change-Id: I339f6893599c5ffc24e738f5ad11f35cbfcaab25
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998371
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Prior to this CL, clippy warnings needless_doctest_main and
blocks_in_if_conditions were suppressed. It turns out they have no
violations, as removing them and running cargo clippy produces no
warning. This CL removes those suppressions.
BUG=b:157245930, chromium:908640
Test=cargo clippy
Change-Id: I82f82bf2fdb7740f45e7187a9b2710fb7dc2ca04
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015559
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Clarissa Garvey <clarissagarvey@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The value of VIRTIO_GPU_RESP_OK_RESOURCE_PLANE_INFO (which is not
upstream) conflicts with upstream VIRTIO_GPU_RESP_OK_EDID. We assign
both VIRTIO_GPU_RESP_OK_EDID and VIRTIO_GPU_RESP_OK_RESOURCE_UUID to the
same value.
BUG=b:2050923
TEST=none (just comments)
Change-Id: I8fe2c3818e451cc456ae6c15b9b827c22cfbd6e9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993318
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Chad Versace <chadversary@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
There is no CLI change in this CL. All existing tests are either
moved to gpu_config.rs or merged with other tests.
BUG=b:254284360
TEST=presubmit
Change-Id: Id9be8247d540337230d20db6f313a983743664b1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971033
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Pujun Lun <lunpujun@google.com>
The gdb feature is supported only on x86_64 and aarch64.
This change removes some compiler warnings.
BUG=b:181763000
TEST=CQ
Change-Id: I22e99574e31147d5ec681bea02c5e0e43c9ca592
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4011922
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Show the debug log to tell the configured default async executor
backend.
BUG=b:251289312
TEST=confirmed the debug log is shown by --async-executor option
Change-Id: I82f040d2ad19739cd486945bae2b5d99492a62a1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006066
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Currently, --async-executor option to switch the backend of
cros_async::Executor is a global option of crosvm main command. This is
because --async-executor is an option to switch the async runtime
backend engine of cros_async crate for a whole crosvm.
However, in practice, only run, device, and devices subcommands have the
motivation to switch the backends for the performance. Other subcommands
may or may not use async functions, but it's unlikely they want to
switch the backends. So, it makes sense to make --async-executor an
option of those three subcommands, not of the global option. Also, it
allows us to switch --async-executor in arvm_dev.conf, which overrides
the options for `crosvm run` command, and to control the async executor
by the coming configuration file feature.
Thus, this commit moves the --async-executor option from the global
command to the run, device, and devices subcommands. This is a breaking
change, but it is unlikely to have many users using this relatively new
option. Takayas also confirmed there's no usage on codesearch.
BUG=b:251289312
TEST=confirmed `crosvm --log-level debug run --async-executor ...`
switches the executor with additional debug log in the coming CL.
TEST=confirmed `crosvm --log-level debug device --async-executor ...`
switches the executor with additional debug log in the coming CL.
TEST=confirmed `crosvm --log-level debug devices --async-executor ...`
switches the executor with additional debug log in the coming CL.
TEST=./tools/dev_container ./tools/presubmit
Change-Id: Ia25f2d0b296b8d73f31d71c362e5f90678166d96
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005473
Auto-Submit: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Using a fixed CID may cause conflict with another guest easily.
Change to use a random CID for a test VM.
BUG=b:258072662
TEST=`./tools/presubmit`
Change-Id: I1f3bab8bd64664b1b2feb480a6d0e285ea4099bb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4012278
Commit-Queue: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The patch makes usb feature no-op on windows as USB pass-through is
not supported on windows.
BUG=b:241251677
BUG=b:213149155
TEST=tools/presubmit
Change-Id: Id82d4c732a86e782695d2af698cc08e8e3fd2d35
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006819
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
This was previously only referenced by the trunks test code, which was
removed in commit 62770b484a ("Remove trunks proto from crosvm
build").
BUG=None
TEST=tools/presubmit
Change-Id: I8883e805037f0da3feb999d685d722cb182bf585
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4010558
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The `chrono` crate attempts to read the local timezone from the TZ
environment variable, and if it's missing, it will try to read
`/etc/localtime`, which uses system calls that are not allowed in the
common device sandbox policy.
Preserve the TZ environment variable from the parent process across the
minijail fork so the /etc/localtime fallback is avoided and no
additional system calls are required in the seccomp policy.
BUG=b:257987535
TEST=Boot ARCVM
Change-Id: Ieaf5e59d0c839ad4c017cc283b81b9eb1430ff67
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4009580
Reviewed-by: Allen Webb <allenwebb@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The non-vhost counterpart already provides this feature flag,
specifying it in the vhost-user implementation will allow
vhost-user net devices to negotiate MTUs too.
TEST=tools/presubmit
Change-Id: If83929671218c45d3e37f782a66b438f9fef5147
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4003960
Commit-Queue: Kevin Hamacher <hamacher@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
These types do not need to be exported.
BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: I5310bb4ce34956d6f6edbbe8a8852b4c18b8130c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005487
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
The `blocking` boolean was converted into a `BlockingMode` anyway, and
using `BlockingMode` directly is also more explicit about what the
parameters is about.
BUG=b:214478588
TEST=cargo build --features `video-decoder,video-encoder,ffmpeg,vaapi`
TEST=cargo test --features vaapi -p cros-codecs
Change-Id: If72067d8218d53ff8d092cef384909d282862e0a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3995885
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
When decoding H.264, ffmpeg tries to set the frame format before
receiving the first DRC event, which is currently rejected even though
this is valid from the point of view of the client. We need to silently
accept the temporary format and all queued output buffers until the
initial DRC event is fired, even though we won't emit any frame.
BUG=None
TEST=`ffmpeg -codec:v h264_v4l2m2m -i Big_Buck_Bunny_720_10s_1MB.mp4 BBB-%d.png`
completes successfully in the guest and produces valid frames.
Change-Id: I9a190ab2748bd59ff57d54be681f2a1553d1c6a3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3841484
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
lseek(2) + SEEK_DATA/SEEK_HOLE is used to find active data in a file.
The api is also effective for memfd. snapshot feature uses to traverse
active pages in the memfd backed guest memory.
BUG=b:215093219
TEST=cargo test -p base unix::file::tests
Change-Id: I9f0eb46a568dadc94231ac437dec25c3478a7d37
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993126
Reviewed-by: David Stevens <stevensd@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Add a tool used in vsock tests to dev_container and guest rootfs
BUG=b:254375643
TEST=`./tools/presubmit` with the new guest rootfs on the new
dev_container
Change-Id: I135e6d2d413bedffef0fd69edd4ab14080429e3a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3974349
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
We no longer need to use the ChromeOS infra for storing the prebuilts
and have updated all other references already. This one was missed.
BUG=None
TEST=run_tests
Change-Id: Ie8ee25d731591c78e3b49ad0dadbed87aaafdf49
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005658
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
When the qcow2 support was moved behind a Cargo feature flag
(--features=qcow), the qcow_utils crate had some of its code modified to
check for `#[cfg(feature = "qcow")]`, but this feature was not actually
present in its Cargo.toml file, so enabling it had no effect.
This can be verified by checking the libqcow_utils.so contains a
create_qcow_with_size() function that does more than just return
-EINVAL.
BUG=None
TEST=emerge-brya crosvm # verify libqcow_utils.so via disassembly
Fixes: 8847de2725 ("qcow: Turn QCOW support into a feature")
Change-Id: I9416908c97d770a6e75324626124af482e6473b2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004348
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Christian Blichmann <cblichmann@google.com>
Commit-Queue: Christian Blichmann <cblichmann@google.com>
The tests require access to vhost syscalls which are not available
in all environments and are not suitable for unit tests.
BUG=b:244623767
TEST=presubmit
Change-Id: I2b6320d005da8966adab3f016237fedf1361055a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004981
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
New containerized builder is ready, and the old builder has been
red for a long time.
BUG=b:240692674
Change-Id: I1b4066c6f12bbfa9f3756ad50c0ceb8a133564c7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004354
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This should allow the builder to turn green as it will contain all
reverts and patches only existed in crOS tree when trying to build.
This is not sufficient to be used as presubmit because it relies on
the target change being merged already.
TEST=led get-builder luci.crosvm.ci:chromeos_hatch | led edit-cr-cl https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004343 | led edit-recipe-bundle | led launch
BUG=b:240692674
Change-Id: I3a4183bfbd007d82803e5a33a56f357868972e80
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004343
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Zihan Chen <zihanchen@google.com>
The tests require root privileges and have been silently
failing in CI because of that.
We will need a mechanism to run tests as root to enable these.
See b/256221093
BUG=b:244623459
TEST=presubmit
Change-Id: If812c219f44221275eabb2892891fd05b432d2fb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3990012
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
These tests require kvm to pass and are not suitable for a unit
test.
In order to move the test, KvmVm::create_vcpu had to be renamed
to prevent conflicts with the trait function VcpuX86_64::create_vcpu,
implemented for the same type.
The aarch64 variant does not actually run in CI since the tests
do not pass in the emulated aarch64 environment. So the
DO_NOT_RUN_AARCH64 flag remains.
BUG=b:244623454
TEST=presubmit
Change-Id: I79bba3926a38d19350e2fd3c7bfa4662499223e5
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999799
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Some of these flags were no longer necessary since we now split
between unit and integration tests.
Others could be enabled by adding some missing dependencies.
BUG=None
TEST=presubmit
Change-Id: Ife5b09a4ee8b27885ee2042d5d93447e8d4deedd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004345
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Cargo already uses the term 'integration test' for tests living
in the tests/ directory of a crate.
To prevent confusion, rename our 'integration_tests' crate to
'e2e_tests'.
BUG=None
TEST=presubmit
Change-Id: Icfa819eaed08be54ab0f36092f1ba367f3f1ce88
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004977
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
These tests require access to kvm and are not suitable for a unit test.
The tests are unmodified and only some visibility changes were made
to allow them to become integration tests.
BUG=b:244623785
TEST=presubmit
Change-Id: I916360f14dba204caca846957bebccf77d451631
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004344
Auto-Submit: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>