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>
CrosVM must ensure that the tap file it uses is O_NONBLOCK, otherwise
the networking is very slow. Currently CrosVM uses O_NONBLOCK when
opening the tap file directly in create_tap_with_ifreq, and it must
ensure the same behavior if the tap file is created from a raw
descriptor.
BUG=b:257304931
Change-Id: I32ce42085ba312993dce32c457a8e5376b94c46b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4003798
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Peter Oskolkov <posk@google.com>
BUG=b:257124165
TEST=build with virgl_renderer but without virgl_renderer_next
Change-Id: I8dda5ad35619920fa0414e6aa6f7d217de8e7a09
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999177
Reviewed-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Yiwei Zhang <zzyiwei@chromium.org>
Update mentions to the deprecated `--disk`, `--rwdisk`, `--root`,
`--rwroot` to use the new `--disk`, and to the obsolete network
parameters to use the new `--net` argument.
BUG=b:218223240
BUG=b:246224081
TEST=`mdbook build` in `docs/book` passes.
Change-Id: I942a9e03980a3477d4b87332f5b4cfdfebba814f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3996046
Auto-Submit: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
For linux based systems, clippy continues to run in health_check
BUG=b:257249038
TEST=CQ
Change-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Currently an error message while parsing arguments goes to only stderr.
It's useful to send it to both syslog and stderr via error! so that
it's evident via crosvm failed (if syslog is present).
BUG=b:251305451
TEST=Send rubbish arguments to crosvm and observe stdout.
Change-Id: Iccbd0a637391f72ddadae447019cf6957635a63b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4000482
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Abhishek Bhardwaj <abhishekbh@chromium.org>
Commit-Queue: Abhishek Bhardwaj <abhishekbh@chromium.org>
Since we will be allowing for multiple audio streams soon (1 playback and 1 capture), we will need a unique completion event name for each stream. Otherwise, if multiple streams are created around the same time, they would be listening for the same event, which would result in bugs where some streams would be notified when they shouldn't have.
This also prepares us for having >1 playback and >1 capture streams as well, if we ever want to have that.
Bug: 253509368
Test: ran emulator and verified sound still works
Change-Id: Id53a4c233579c0ffba750b6663111e6c02f02dfd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3997600
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
The future DeviceCapturer object will use a lot of the functionality for DeviceRenderer. This CL will refactor these methods so that they can be shareable.
TEST=In downstream branch, ran emulator, verified sound still works
BUG=b:253509368
Change-Id: I468eafeab0a9741332a360638b267366c06fe944
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994883
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
In non-privileged containers, comparing a file descriptor may not
work. So the test will not work in every runtime environment.
BUG=b:244623061
TEST=dev_container --podman --unprivileged tools/run_tests base:base
Change-Id: Ifa67e11db9694c36b47cd5ae88de9247284e1cdf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3999711
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Use the off64_t versions of libc file functions.
There is no Rust libc crate equivalent of the C _FILE_OFFSET_BITS and
related defines, so we have to use the Linux-specific *64 variants
explicitly.
This extends the size of file offsets to 64 bits instead of 32 on
platforms with 32-bit userspace.
(It also fixes the recently introduced check for non-LFS functions in
ChromeOS - see b/201531268 for details.)
BUG=b:201531268
TEST=emerge-kevin crosvm
TEST=start Crostini on kevin
Change-Id: Ife42917c8896d4fa1ccd78051c2a0b7dd565b2b3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3979975
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The most notable changes are:
* Playback Async support
* Audio Client flags to hide app from SndVol when audio session has
expired
* Updates to audio_streams and cros_async crates for playback async
support
BUG=b:256655413
TEST=Verified to work downstream
Change-Id: Ifbe9a15791feaa41d6e1d5eaf2c5824b2c7c25b8
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3994882
Commit-Queue: Richard Zhang <rizhang@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>