Commit graph

5210 commits

Author SHA1 Message Date
Alexandre Courbot
97fe4ec8e8 media: cros-codecs: harmonize error descriptions
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>
2022-11-09 02:35:58 +00:00
Alexandre Courbot
13f21379ac media: cros-codecs: remove unneeded type suffixes
Indices are already usize implicitly.

BUG=b:214478588
TEST=cargo test --features vaapi -p cros-codecs

Change-Id: I555a4feb5669906c73004e598744311e3351090a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4005488
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>
2022-11-09 02:30:13 +00:00
Alexandre Courbot
9add805a30 media: cros-codecs: remove InnerHandle types
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>
2022-11-09 02:27:24 +00:00
Alexandre Courbot
54ce45da43 media: cros-codecs: factorize DynDecodedHandle definitions
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>
2022-11-09 02:21:42 +00:00
recipe-roller
df04f299b3 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798012292205025025

depot_tools:
ae1a708917
  ae1a708 (vadimsh@chromium.org)
      Update lucicfg to v1.33.7.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: Idd3b77aa7b9e5c4ee25b32a91f41c9714499ce13
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4015564
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-09 02:15:08 +00:00
Alexandre Courbot
5e6927adeb media: cros-codecs: factorize DecodedHandle definitions
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>
2022-11-09 01:47:41 +00:00
Alexandre Courbot
0545497647 media: cros-codecs: factorize SurfaceContainer implementations
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>
2022-11-09 01:47:41 +00:00
Alexandre Courbot
b8c4b8289c media: cros-codecs: factorize Picture definitions
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>
2022-11-09 01:47:41 +00:00
Alexandre Courbot
1c962fc899 media: cros-codecs: move H.264 picture data into its own struct
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>
2022-11-09 01:47:41 +00:00
Alexandre Courbot
acc3aa6532 media: cros-codecs: simplify the Picture interface
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>
2022-11-09 01:47:41 +00:00
Clarissa Garvey
c0e235ae2d Enable clippy warnings with no violations
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>
2022-11-09 00:47:12 +00:00
recipe-roller
edd3e98d7c Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798020470267050561

depot_tools:
be2e926c5e
  be2e926 (gavinmak@google.com)
      Add new constants for last-upload-hash and gerritsquashhash

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I2606f9dc79032eb0c786a6689e647325dc8d124f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014837
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-08 23:55:23 +00:00
Chad Versace
92ddca9e82 gpu: Document conflicts in VIRTIO_GPU_RESP enum values
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>
2022-11-08 22:54:39 +00:00
recipe-roller
f084f9abb7 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798038086932440993

recipe_engine:
f1dbdbfbc0
  f1dbdbf (bshai@google.com)
      switch to inspect.getfullargspec in py3

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I44983162c3203f49c8c09d9ef1013f1f9caa646f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4014820
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-08 19:16:01 +00:00
Pujun Lun
a7bb180180 crosvm: unify GPU arg parsing for Unix and Windows.
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>
2022-11-08 17:59:45 +00:00
Keiichi Watanabe
621e719751 cargo: Deny compiler warnings
Fix exiting compiler warnings and enable "-Dwarnings" to reject code
emitting new warnings

BUG=b:181763000
TEST=CQ

Change-Id: I2ab69e861f0bf9dee8378ac1b33354c87a6a0c42
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4011747
Auto-Submit: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-11-08 16:53:48 +00:00
Keiichi Watanabe
6e4190b571 cargo: Remove gdb feature from all-armhf
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>
2022-11-08 16:53:48 +00:00
Takaya Saeki
b9295d8ba9 cros_async: show debug log when setting the default executor.
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>
2022-11-08 06:34:08 +00:00
Takaya Saeki
303c285b7f cros_async: Move --async-executor to run/device/devices subcommands
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>
2022-11-08 06:29:20 +00:00
Ryuichiro Chiba
4db19f1baa e2e_tests: vsock: use a random cid for a guest
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>
2022-11-08 04:26:47 +00:00
recipe-roller
5930a1baef Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798113584502444513

depot_tools:
d9db3f6fd8~..e6f3d66bae371ddf8ccd91d26ec788dd75d3f5a7
  d9db3f6 (theosiu@google.com)
      Add arch flag and env variable for overriding on mac
  e6f3d66 (pkasting@chromium.org)
      Fix bad regex.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I0d2b0aa5c14ee580035dee0dbef47f323acf37e6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4010940
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-07 23:14:35 +00:00
Vikram Auradkar
1b32084a56 crosvm: Enable default features on windows.
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>
2022-11-07 23:03:25 +00:00
Daniel Verkamp
1ea13674fa protos: delete unused test helper function
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>
2022-11-07 22:12:32 +00:00
Daniel Verkamp
df7164273e devices: proxy: set TZ in sandboxed device process
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>
2022-11-07 21:00:58 +00:00
Kevin Hamacher
02bc918e74 devices: vhost: user: vmm: Allow MTU negotiation
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>
2022-11-07 11:52:21 +00:00
Alexandre Courbot
9206613bdc media: cros-codecs: do not export module local types
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>
2022-11-07 10:58:03 +00:00
Alexandre Courbot
02eff72038 media: cros-codecs: make poll() take BlockingMode directly
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>
2022-11-07 10:54:58 +00:00
Alexandre Courbot
9167a10db1 video: decoder: ffmpeg: fix H.264 decoding with ffmpeg in guest
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>
2022-11-07 10:50:23 +00:00
Shintaro Kawamura
985e575e66 base: unix: find active pages in a file
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>
2022-11-07 06:27:47 +00:00
Ryuichiro Chiba
9406b788c3 e2e_tests: Add vsock tests
Add vsock tests to confirm the vsock device works at crosvm upstream

BUG=b:254375643
TEST=`./tools/presubmit`

Change-Id: I24137e00dc449c97be8ee7e9101906541ea843d1
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3998914
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-11-07 05:54:34 +00:00
Ryuichiro Chiba
df7a2e51bf e2e_tests: Add a tool to dev_container and guest rootfs
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>
2022-11-07 04:00:40 +00:00
Vikram Auradkar
befb1ccaa9 devices: enable tests for audio on windows
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=tools/presubmit

Change-Id: I4619a5c9f1ff8b5ce00b4c7b7c4f5b19cff42471
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006817
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-04 20:52:45 +00:00
Vikram Auradkar
638694c979 devices: enable audio and usb for windows
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=ran downstream tests

Change-Id: I8982148c14dccd0ab43c170f431d0a8f77848bbb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3967445
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
2022-11-04 20:30:24 +00:00
Vikram Auradkar
4abd4185f7 devices: resync a few files for clippy.
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=ran downstream tests

Change-Id: Iafb1c0a7cea5706b9f4fc887ec5f698c5df41fc2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3967444
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-04 20:24:44 +00:00
Vikram Auradkar
16c832e0eb devices: ac97: windows: Convert mute Mutex<bool> to AtomicBool
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=ran downstream tests

Change-Id: Ie7d1650baeeaeea5ee0391d50e61335eb09dcefd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3967443
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-04 20:22:35 +00:00
Vikram Auradkar
5d49f50183 devices: upstream windows support for ac97_bus_master
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=ran downstream tests

Change-Id: I458da7bd6901513322aa1452cf50f6cbcb1d99b4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3881726
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Auto-Submit: Vikram Auradkar <auradkar@google.com>
2022-11-04 20:14:39 +00:00
Vikram Auradkar
f68d372e79 devices: Move AudioError under sys/unix
BUG=b:213149155
BUG=b:150630566
BUG=b:236297362
TEST=tools/dev_container tools/presubmit

Change-Id: I12891325903a5d10fb230bba8d0fe03f83696761
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4001084
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
2022-11-04 19:41:16 +00:00
Dennis Kempin
004417152f e2e_tests: Update prebuild URL to crosvm-infra
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>
2022-11-04 19:06:20 +00:00
recipe-roller
5e8a3f1580 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798401731366541553

depot_tools:
03b187d9c8
  03b187d (pkasting@chromium.org)
      Avoid IWYU warnings on other namespaces for <algorithm>.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I0777a214f67de2f65bd37b21ab5ae1d1ec118237
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4006814
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-04 18:55:02 +00:00
Daniel Verkamp
36bb092978 qcow_utils: add qcow feature to Cargo.toml
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>
2022-11-04 08:27:03 +00:00
Dennis Kempin
7eadfac122 vhost: Move tests into an integration test
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>
2022-11-04 06:49:36 +00:00
Zihan Chen
8af881fa56 infra/recipes: remove original crOS builder
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>
2022-11-04 01:59:49 +00:00
Zihan Chen
6005604ca0 infra/recipes: Use cherry-pick instead of checkout in crOS builder
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>
2022-11-03 23:42:00 +00:00
recipe-roller
857245d585 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (recipe_engine) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798475343019348369

recipe_engine:
e31bdf086d
  e31bdf0 (chromium-autoroll@skia-public.iam.gserviceaccount.com)
      Roll CAS Client from 51ea7aad25ff to f8f64a8c560d

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I93987a17d3a571997056db8af7f302a146125767
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004353
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-03 23:31:57 +00:00
Dennis Kempin
9d24750e7d net_util: Extract integration_test
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>
2022-11-03 23:29:15 +00:00
Dennis Kempin
3375878f14 Move hypervisor::kvm tests to integration tests
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>
2022-11-03 23:19:11 +00:00
Dennis Kempin
b50f6580a2 test_config: Cleanup and enable some video crates
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>
2022-11-03 23:03:54 +00:00
recipe-roller
9841dd06c3 Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls
recipe changes from upstream projects (depot_tools) into this repository.

The build that created this CL was
https://ci.chromium.org/b/8798477223084010833

depot_tools:
4cf73e01ab
  4cf73e0 (vadimsh@chromium.org)
      [cipd] Update luci-auth.

Please check the following references for more information:
- autoroller, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#autoroller
- rollback, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/workflow.md#rollback
- cross-repo dependencies, https://chromium.googlesource.com/infra/luci/recipes-py/+/main/doc/cross_repo.md

Use https://goo.gl/noib3a to file a bug.

R=denniskempin@google.com

Recipe-Tryjob-Bypass-Reason: Autoroller
Ignore-Freeze: Autoroller
Bugdroid-Send-Email: False
Change-Id: I0f535e0e7cf1c89d517755b4f951b0f970b58fd2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4004352
Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Bot-Commit: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
2022-11-03 22:54:15 +00:00
Dennis Kempin
009cb53c76 Rename integration_tests to e2e_tests
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>
2022-11-03 22:49:39 +00:00
Dennis Kempin
f7016c860c x86_64: Extract integration tests
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>
2022-11-03 22:47:21 +00:00