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>
Add a preliminary version of pgbench running in e2e_tests
facilities. It currently does nothing with the benchmark result.
TEST=Can pass and produce results with `./tools/bench postgres`
BUG=b:257303497
Change-Id: If2f06cb0a9c91f5d7240094bacf86fc681062127
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4763144
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
This will record the thread/window messages flowing through our message
pump. It could help debug window not responding issues like b/264846691.
TODO(b/252870196):
Add freeze detection and trigger simulated crash reports.
Bug: 264846691
Test: Triggered crash reports and checked the generated traces
Change-Id: If7a9fc4da40ed5b56cb7eff40e2680eccf0c6150
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4804800
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Auto-Submit: Kaiyi Li <kaiyili@google.com>
unit test for create_layer
BUG=b:297954291
TEST= Run cargo test and the tests pass
Change-Id: I8e7b36a53c9f3083192d72f6375d870a75e9976b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4857968
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
The error ENOENT is reported in `epoll_ctl(2)` as an error code we
return when the poll operation is asked to modify or delete an fd that
is not being polled by the current instance. In this case, we don't need
to fail as we can just silently ignore the error. This allows us to
delete fds in an idempotent way without failing.
In our codebase we currently do not rely on this ENOENT error behaviour
to bubble up so we can safely transparently drop this error.
BUG=None
TEST=presubmit
Change-Id: I1ab9b9300e0e48340db71b10281107290439e24b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4875917
Auto-Submit: Morg <morg@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Morg <morg@google.com>
This CL adds the option to "pause" and "resume" polling on a given file
descriptor for the event_loop. This is useful in situations where we
want to temporarily stop reading from a file while maintaining a
reference to its event handle that we can resume polling on at a later
time.
BUG=b:297957754
TEST=presubmit
Change-Id: Idf8c9eb0663139ff6e8ba61566c57c0c591f5cef
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4865766
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Morg <morg@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Morg <morg@google.com>
When taking a snapshot, all vsock connections are dropped due to the way
sleep and wake are implemented (at least on Windows). This isn't
what we want since sleep/wake shouldn't be destructive, and when they
are it can cause a VM to break unexpectedly when all the vsock
connections get broken. This CL modifies the Windows vsock
implementation to keep connections around between sleep/wake. Of course,
connections will break across a snapshot/restore, but that is expected &
normal.
BUG=b:300365100
TEST=took snapshot & verified vsock host app remained connected as
expected.
Change-Id: If82bebc49bd0bab4d8bd0b54e704b7fe43f8834f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4873794
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Richard Zhang <rizhang@google.com>
Filter by event_name and how many time-consuming events to output
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Id2375a394cd43da8d9342d309c3830f19b51654e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4853089
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
unit test for populate_event_names and calculate_latency_data
BUG=b:297954291
TEST= Run cargo test and the tests pass
Change-Id: Iff7a3ebcead4b2d777881c0f1cb5859e126bc5c4
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4857960
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Reviewed-by: Morg <morg@google.com>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Extract name and latency of all events output it to json file
BUG=b:297954291
TEST= Run the tool with a trace.dat collected by trace-cmd.
Change-Id: Iea72e4aebaaecc4b11e7289af771540c32938d71
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4839555
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Commit-Queue: Natsuko Mineno <natsukomineno@google.com>
Delegate has been restructured to support this change, and sadly
Win64 compile exclusion has to be reintroduced to avoid compiling
this binary on Windows.
Now e2e_tests can explicitly obtain result (including stdout/stderr/
exit code/signal) from command ran in test guests.
BUG=b:257303497
Change-Id: Ibcd773b69cca9708a8dacb34cc870ca527fa32c3
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4787727
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Zihan Chen <zihanchen@google.com>
Remove the cfg(target_arch = "x86_64") checks for the vTPM feature,
since there is no architecture-specific code involved - it is simply a
wrapper around a D-Bus service.
Builders of crosvm can choose not to enable this feature using the vtpm
feature flag, as before.
BUG=None
TEST=tools/dev_container tools/presubmit
TEST=cargo build --target=aarch64-unknown-linux-gnu --features=vtpm
Change-Id: I432b5a129165964ac34842ec9b264fd3f570b10c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4875224
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This feature is enabled by default, so builds using the default feature
set should get the same functionality as before.
Fixes mingw --no-default-features build since now both net and slirp are
disabled by default. Windows builds with net but without slirp will not
work (failing at compile time), but that is effectively the same
behavior as before.
BUG=b:260607247
TEST=cargo build --target x86_64-pc-windows-gnu --no-default-features
Change-Id: I97f6a8bfd7b9e6673cafee4f22cb7c08c1627a75
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4823133
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This CL splits the logic of a generic backend device provider with the
specific implementation of a host backend device provider (backed by
usbdevfs semantics). By separating common logic with backend-specific
implementation logic, we make it easier to implement alternative
backends (like virtual USB devices) in the future.
BUG=b:297957754
TEST=presumit
Change-Id: I1f38708cb7aefd324977e72f3f38da6f37b31213
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4865911
Commit-Queue: Morg <morg@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Ryuichiro Chiba <chibar@chromium.org>
Auto-Submit: Morg <morg@google.com>
Had to tweak the assert because the queue snapshot no longer has an
"activated" field.
The first `vm` created wasn't dropped until the very end of the test and
then the shutdown would hang (didn't debug why). Added a scope so that
everything from the first VM is dropped before we attempt the restore.
Change-Id: I9e3a10dbe08045d581742645d8305ba1951530cf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4875223
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
Reviewed-by: Elie Kheirallah <khei@google.com>
Some devices require a control tube for creation, whereas some others have
the control tube as an option, and some don't even have a tube. Some
might have additional state. Those get passed in the context argument.
BUG=b:292276136
TEST=cargo test
Change-Id: I49c0732929de1b603093ed081bd4dd8107c61ba2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4860866
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Elie Kheirallah <khei@google.com>
Reviewed-by: Frederick Mayle <fmayle@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Elie Kheirallah <khei@google.com>
For the named pipe console, we shouldn't start reading from it until the
pipe is connected otherwise we get a bunch of errors due to the pipe not
being connected. There are still other major issues with the pipe
console, but it'd be good to fix this one for now.
BUG=b:297294476
TEST=tested with other fixes and the console seems to work.
Change-Id: I74a3e4b0a587f8a9dc52083d2ed2cec69a75283b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4867358
Commit-Queue: Noah Gold <nkgold@google.com>
Reviewed-by: Vikram Auradkar <auradkar@google.com>
cloud-init takes care of resizing the rootfs to fit the size of the
block device.
The downloaded image size is the same as before since it's a compressed
qcow2 file.
This will improve stability of parallel tests to allow multiple
snapshot tests to run at the same time.
BUG=b:300669562
TEST=run_tests --dut=vm
Change-Id: I1e90f2a54e449696b60e338c1097e42eedba9bae
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4869245
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
This will pick up the nextest.toml configuration for postsubmit,
enabling postubmit failures for flaky tests.
BUG=b:300669562
TEST=NEXTEST_PROFILE=postsubmit dev_container presubmit
Change-Id: I9b518aebbcba083e670fa8a5099b846316a6864c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4863126
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
We used to cap the guest resolution at 1080p. We are experimenting with
higher resolutions, gated by the feature flag enable_4k_uhd_resolution.
Two places need to change:
1. The virtual display size should be capped at 3840x2160 instead if the
feature is enabled. This size is used as the guest resolution.
2. guest_dpi_manager should provide the recommended DPI for the newly
added resolutions. It is fine not to check the feature flag there
since the BSS knows whether or not to use those values.
get_virtual_display_size() may be called by validate_gpu_config(), which
happens very early and the process variants are not yet written to the
static variable PROCESS_INVARIANTS, so we can't use the macro
phenotype!. As a workaround, we load the process variants and read the
flag by ourselves. In the long term, the BSS should be specifying the
virtual display size when launching KiwiVM, so we should be able to get
rid of This workaround.
Bug: 276352265
Test: Ran GPG with the feature enabled/disabled, and verified that the
resolution is capped at 4k UHD when it is enabled.
Change-Id: I3ec06deda1aa5b7fe89dde5bca426248b93b3ecf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4804797
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Kaiyi Li <kaiyili@google.com>
For more coverage.
BUG=b:266514902
Change-Id: I9ec4e391d3012b733d6809f6b219b96e0699635b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4868581
Reviewed-by: Elie Kheirallah <khei@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Frederick Mayle <fmayle@google.com>
This implements the command line option for scsi devices. virtio-scsi is
supposed to be much more versatile than virtio-blk; it is capable of
returning detailed of errors, more than 28 devices can be attached
(while not possible in virtio-blk), it can emulate optical devices, etc.
This commit adds a command line option --scsi-block. For now, we do not
create SCSI device or handle virtio-scsi requests, but the features will
be added in the following commits in the CL chain.
cf) This is the spec of virtio-scsi
https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-3520006.
BUG=b:300042376
TEST=tools/presubmit
TEST=crosvm parses the --scsi-block option.
e.g.) ./crosvm run -b /path/to/root-image --scsi-block
"/path/to/another-image,ro" /path/to/kernel
Change-Id: I23eb10de191004ba43527dbf7adee684ad5aaf43
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4840762
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Commit-Queue: Joe Hattori <hattorij@google.com>
We have a get_device_backend() that locks and returns the device
backend, yet we never use it in the usb_hub code. It's more appropriate
to use it when possible so we don't incur in incosistency bugs if we
decide to change the getter later.
Also, as per rust style guide, we get rid fo the "get" name in the
method.
BUG=None
TEST=presubmit
Change-Id: Ifcbced0618b7bc31cd89dac2a31a4b32eed31b57
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4865906
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Auto-Submit: Morg <morg@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
If the Tube is None, then activate will crash.
BUG=b:266514902
Change-Id: I587224730caa1bcfd661d8e55f172c9e32133d49
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4867477
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Elie Kheirallah <khei@google.com>
Make the vmm_vhost Tube connection (used on Windows) match the behavior
of the Socket connection (used on Linux) by returning the specific
VhostError::Disconnect type rather than a generic TubeError when the
client disconnects. This also propagates into the special handling in
recv_header() that translates a VhostError::Disconnect into a
VhostError::ClientExit when the client exits at a clean point in the
connection.
Change-Id: If22e319f1e3657d95610601eb00eaab237aabd2f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4854945
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Document the expectation that each change in a series of related changes
must pass the tests.
Change-Id: I9f704b8343ecd93482ad7321192b6175da65b52c
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4865160
Reviewed-by: Morg <morg@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This function is unused after the removal of vvu.
Change-Id: Iaff036f7228c237c80211b41452b1006d7d9a377
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4859206
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>