The Le16/Le32/Le64 <-> u16/u32/u64 conversions should be no-ops on
little endian platforms, and even the big-endian conversions can be
efficiently implemented with a single byte-swap or MOVBE instruction in
most cases, so it should almost always be beneficial to inline the
conversion functions.
BUG=None
TEST=cargo build --release; view SplitQueue::add_used assembly
Change-Id: Ia028670e99f93754e729b3ff1fbdae2bcef74917
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4679848
Reviewed-by: Zihan Chen <zihanchen@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
- The remaning DataInit are all left due to limitations of the
current stable version of zerocopy
- Only 5 files still use DataInit
- DataInit is marked as deprecated to prevent future introduction
- Other mentions of DataInit across the repository are cleaned up
TEST=CQ
BUG=b:204409584
FIXED=b:204409584
Change-Id: Id7126e58cff63eaa67138de429375382a3ffbc55
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4680289
Auto-Submit: Zihan Chen <zihanchen@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
the BalloonWssConfigFfi struct was missing a #[repr(C)]
annotation, causing the generated header file to not include the struct
definition. this patch also removes a couple unneeded constants.
BUG=None
TEST=built crosvm_control, checked generated header
Change-Id: Ic02c2145d16143257f5096d4811a4012bb827d69
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4607224
Reviewed-by: T.J. Alumbaugh <talumbau@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: maciek swiech <drmasquatch@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
for ease of initial implementation the number of WSS bins was hard-coded
to 4, however the WSS spec and kernel driver permit any number of bins
between 2-16. this patchset introduces a crosvm run flag which allows to
override the default 4 bins.
the protobuf-encoded WSS report will scale the number of bins correctly
in the return value, however the C crosvm_control_* API will always use
an array of 16 buckets, with a `num_bins` parameter that indicates how
many of them are actually valid. this has been done to preserve safety
across the ffi boundary.
this patchset also removes the sending of an initial WSS config. the
coordinating program (e.g. concierge et al.) is responsible for sending
the config to the guest after boot via the crosvm_control_* API. this is
largely due to the fact there may be various desirable configs for
varying scenarios and it does not make sense to have a baked-in default
config anymore.
BUG=b/278118696
TEST=https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger-variable-bins
Change-Id: Ifaef2933a13a59d8d2580b5a9e283568fe6e86cf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4577421
Commit-Queue: maciek swiech <drmasquatch@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reland CL:3824000 since libcras removed its usage in CL:4574167.
All test uses have been eliminated in CL:4215512, so we can remove it now.
This was an unsafe abstraction, and we have better alternatives (such as
the read_obj()/write_obj() functions) that do not create a long-lived
mutable reference that could easily alias other slices.
BUG=b:284938484
TEST=cargo test common/data_model/Cargo.toml
Change-Id: I552f22895ae651d6f8ce55d00f20e2950d050db9
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4569901
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
The Windows version of IoBuf uses the WSABUF structure, which represents
len as a 32-bit value. Previously, larger len values would be silently
truncated; this change makes those conversions using try_into() instead.
We have no easy way to report failure of this usize -> u32 conversion,
so for now, just unwrap() to cause a panic if the length ever overflows
so it will at least produce a crash report and be noticed.
A possible future enhancement could be to make all relevant IoBuf and
IoBufMut functions return Result<...> so the error could be propagated
back to the caller.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: I79270a7e8af01827ef0d1bafaa98c5d7f4b53b73
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4567110
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Most of the IoBufMut code is generic and doesn't need to be implemented
for each platform. Factor out the sys-specific parts into a new trait,
PlatformIoBuf, that contains the minimal accessor functions for getting
and setting address and length.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: If647dd268f8ccdb8ecba2dcf5b12711363a32c69
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4559526
Reviewed-by: Zihan Chen <zihanchen@google.com>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
We no longer need to share cros-fuzz with ChromeOS. So we can
consolidate our fuzzing code and reorganize it to work well
with `cargo fuzz`.
BUG=b:279217867
TEST=cargo +nightly fuzz build --fuzz-dir=crosvm-fuzz -O
Change-Id: I75653961c6cbf251af9e54f894d6f20ea1218b53
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4539922
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
This allows it to run on oss-fuzz as well.
BUG=b:279217867
TEST=cargo +nightly fuzz run --fuzz-dir=crosvm-fuzz -O
--features upstream-fuzz crosvm_p9_tframe_fuzzer
Change-Id: Id0d24901d454967a94c4b7487916cb805e205450
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4539920
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
The previous maximum size was 64K minus 1 byte; this also did not leave
room for the request/response header, so the actual maximum transfer
size in a single request was slightly smaller.
Use 64K + 24 bytes, since this matches the P9_IOHDRSZ subtraction used
by the Linux 9p client to calculate the maximum I/O size.
BUG=b:265610073
TEST=strace 9s on host and verify larger read()/write() syscalls
Change-Id: Ia606222d3c52a7a6e3f6cfca1a9fcbd78e223855
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4455812
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The iounit value is meant to be an upper limit on the size of each I/O
sent by the client: <https://9p.io/magic/man2html/2/iounit>
Previously, we used the stat() st_blksize value for iounit; this caused
the Linux 9p client to split up every read/write request into 4096-byte
chunks in the usual case of an ext4 host filesystem, which causes very
low performance.
Report iounit=0 instead, which will allow the client to send Tread and
Twrite requests up to the negotiated msize (maximum message size).
BUG=b:265610073
TEST=strace 9s on host and verify larger read()/write() syscalls
Change-Id: I86341998f440ac1c567da7d8fc6e740189ccb44a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4455811
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
balloon size is useful for balloon policies using working set size, so
we return the balloon-device cached balloon size. unless there is some
error in adjustement of the balloon, this should reflect that real
balloon size and saves having to query the guest an additional time.
BUG=b/278119213
TEST=run bzImage
Change-Id: I7c6b558358b8db099a737430e8431997bb110b2b
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4428532
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: T.J. Alumbaugh <talumbau@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Maciek Swiech <drmasquatch@google.com>
this patch adds the crosvm_control command (and internal implementation)
to send a new WSS config command to a guest balloon driver. included is
a refactor of how wss op notifications are dispatched in the balloon
device.
BUG=b/271891148
TEST=run bzImage
TEST=socket-pinger program available at https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger
Change-Id: Id9696b0e82b3ba54d87cd0928070c55da9a77d1f
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4415596
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
for wss, s/intervals/config, add new field to track bytes for ANON and
PAGE memory.
BUG=b:271757427, b:273212204
TEST=crosvm run bzImage
Cq-Depend: 4404310
Change-Id: I62696135d1e3af9219ba819f112a1ed128e39600
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4405307
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
this patch implements the virtio-balloon extensions proposed in
go/roziere - namely adding the Working Set Size vqueues and listener on
the wss vqueue. in addition we add a crosvm_control command which allows
a user to request that the balloon device send a request to the driver
to produce a WSS report, similar to asking for balloon stats.
BUG=b:271757427,b:273212204
TEST=sidecar process, available at https://x20.corp.google.com/users/dr/drmasquatch/socket-pinger
TEST=deploy to DUT, restart termina and arcvm
Change-Id: I45753f523aae97d14bfc5dcbad5ddfcb70d10beb
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4260158
Reviewed-by: T.J. Alumbaugh <talumbau@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Maciek Swiech <drmasquatch@google.com>
The compiler already infers the correct types without the extra
&(ref ..., ref ...), so just drop them.
Fixes clippy lints in Rust 1.68.
BUG=b:276487055
TEST=tools/clippy # with rust 1.68
Change-Id: I0947d653c80e7c7a5a561d2970ecae24a3700adf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4390736
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This is supported since Rust 1.62.
Fixes the new derivable_impls clippy lint, added in Rust 1.67.
BUG=b:276487055
TEST=tools/clippy # with rust 1.68
Change-Id: I3696dd3cf4acbf9b5a2cfa8c2046e7656e13dbbd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4390735
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
"crosvm swap trim <socket_path>" command for trimming 2 types of pages
in the staging memory before swapping out to reduce the disk I/O.
* clean pages
* zero pages
The doc comment of TrimContext explains the page types.
BUG=b:265592787
TEST=cargo test -p swap
Change-Id: I5c33149f7d0bfd712f07fd11eb9aa07c1a8b0e7a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4357224
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Shin Kawamura <kawasin@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Replace use of env::temp_dir() with tempfile::tempdir() to ensure each
test gets a unique temporary directory name. This avoids test failures
when running multiple tests simultaneously.
BUG=b:274145919
TEST=tools/dev_container tools/presubmit
Change-Id: Iac3a248d52830f3efafd8a954d1cc9633f71f301
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4350606
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
The SafeDescriptor type manages the lifetime of the file descriptor,
which simplifies the socket wrappers (each wrapper no longer needs to
manually implement Drop to close the descriptor, for example).
Also remove unneeded RawFd-related functions, replacing them with
RawDescriptor and SafeDescriptor equivalents.
BUG=None
TEST=tools/dev_container tools/presubmit
Change-Id: I634a19922ec24d06071b21247c79761cfc21a79a
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4322266
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Add latency_bytes to the AsyncBufferCommit and the BufferCommit trait
to allow virtio sound device to report the audio latency from the
virtio_snd_pcm_status.
BUG=b:269989582
TEST=play Audio Video Sync Test video from the ARCVM youtube app.
Change-Id: I9415933ed1bd8e3b326fe2c5c73a835ed96dff02
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4273577
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Auto-Submit: Judy Hsiao <judyhsiao@google.com>
Add flag `--cfg` to `crosvm device fs` command to change options
such as posix_acl.
Currently `crosvm device fs` uses hard-coded default config, which
enables posix_acl as default. If a host filesystem without POSIX ACL
support is shared to the guest though virtio-fs, `ls` command in the
guest will fail.
TEST=tools/presubmit
BUG=b:259728763
Change-Id: Ie98c097c74336ce4f756b0ee8541eecbd102d272
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3967441
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Changyuan Lyu <changyuanl@google.com>
This CL is to prepare for parsing virtio-snd parameters from cmdline
argument to StreamEffect with serde_keyvalue. Deserialize will be used
when parsing from cmdline. Serialize will be used when we store
StreamEffect inside Parameters struct as the whole struct must be
serializable.
BUG=b:269984052
TEST=cargo check
Change-Id: Ica2169f395f53a4884d407c07fedff16d13cbedd
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4273570
Commit-Queue: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
The standard library equivalent is called std::io::IoSliceMut, not
IoBufMut.
BUG=None
TEST=read it
Change-Id: I66956f403e762d84bd46b05e986415f319d5bcbf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4262436
Commit-Queue: Zihan Chen <zihanchen@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Zihan Chen <zihanchen@google.com>
This CL removed many uses of DataInit in devices. Some paddings
are manually added/fixed to allow AsBytes to derive without ABI
changes.
TESTED=CQ
BUG=b:204409584
Change-Id: I1f8c2d5304fc8e685cc3e5166c73481f6a3f78f7
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4235224
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: 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 is a reland of commit d39e5811df
This change mark VolatileRef as deprecated instead of removing it
completely. This change also removed all related methods and functions
using VolatileRef that libcras don't use.
Original change's description:
> data_model: remove VolatileRef
>
> All uses except in test code have been eliminated, so we can remove it
> now.
>
> This was an unsafe abstraction, and we have better alternatives (such as
> the read_obj()/write_obj() functions) that do not create a long-lived
> mutable reference that could easily alias other slices.
>
> BUG=None
> TEST=tools/presubmit --all
>
> Change-Id: I84f1e2487d6211ce24b8fc992fa7675765870132
> Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3824000
> Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
> Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
> Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
TESTED=CQ
BUG=b:204409584
FIXED=b:236759218
Change-Id: I4019870a2321fcd8610669862b5e6ed9bf7c2282
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4215512
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Zihan Chen <zihanchen@google.com>
- Revbum to 0.1.1, 0.1.0-{anything} causes data_model
0.1.0 to be downloaded since it's a higher release number.
- Also, add include LICENSE in the package includes for
data_model.
- Also, use the correct version when not using path in rutabaga_gfx.
BUG=b:173630595
TEST=compile
Change-Id: I68af3eb1fa4ab89a77968f784e388b10c94d8b97
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4209693
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
If the header of an incoming message can be decoded, but the body of
that message is invalid in some way (such as a string containing byte
sequences that are not valid UTF-8), the server should respond by
sending the Rerror message rather than closing the whole connection.
If the header cannot be decoded (for example, if the specified size is
too small), it is not possible to resynchronize the byte stream, so the
connection will still be closed in this case.
BUG=b:243123191
TEST=(cd common/p9; cargo test)
TEST=touch /mnt/chromeos/MyFiles/Downloads/$'\351'
Change-Id: I5f10e357a9b1734497bc2d2d8b5de544f86604ae
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4182888
Reviewed-by: David Munro <davidmunro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Instead of configuring which crates to --exclude in
test_config.py, we can use conditional compilation to
exclude code that is not supported on windows.
This allows more fine-grained control and also allows
us to use plain cargo for building without complicated
configuration and exclusions.
BUG=b:265829867
TEST=cargo test --lib --bins --workspace
--target=x86_64-pc-windows-gnu
--features=all-mingw64
Change-Id: I8422c3f08053bc27d9896b220876a56bd25543d6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4165868
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Adds a fall-back to cros_fuzz when compiled without
fuzzing enabled that will just produce a main fn entrypoint
with the fuzzing code.
This allows the fuzzing code to be compiled, but won't produce
functional fuzzing binaries.
BUG=b:265829867
FIXES=b:244631591
TEST=crosvm CQ
cargo +nightly fuzz run --fuzz-dir crosvm-fuzz --features upstream-fuzz crosvm_block_fuzzer
Change-Id: Ib2602aab5c5373cb2a71dca0d8419640a00c6725
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4167143
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Reviewed-by: Zihan Chen <zihanchen@google.com>
data_model is probably going away in the future, but
until we can release it as pre-release alpha for internal
efforts.
(context: https://fxbug.dev/114169)
BUG=b:173630595
TEST=compile
Change-Id: Ie13ec3ab9083d315c78a035b532132296a8fb651
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4082333
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
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>
Add default implementation for wait_fd_readable to help with uprev
process with older package of cros_async.
BUG=b:258759773
TEST=emerge audio_streams
Change-Id: I494ac8615e4d73a0cceaf4c2e1beb6e04e9eedc6
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4086627
Commit-Queue: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Add async_new_async_{playback,capture}_stream to StreamSource trait.
These methods are used to create new async playback or capture stream
asynchronously. Default implementation is to call their sync version.
cros_async: Add wait_fd_readable to AudioStreamsExecutor trait, this
will be used by libcras to implement the new async_new_async_*_stream
method.
BUG=b:258759773
TEST=emerge audio_streams cros_async
TEST=FEATURES=test emerge-amd64-generic audio_streams
Change-Id: I8dfc743eb8fa6552a1a6b2953b79666e2909e417
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4066242
Commit-Queue: Pattara Teerapong <pteerapong@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
readlink support works in 9p. Symlinks will now stat and
read correctly. A unit test is added.
BUG=None
TEST=cargo test -p p9
Change-Id: If37e0e716535d17222fe67c013986720180b5cb2
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4072744
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Ron Minnich <rminnich@google.com>
When passing the initial path to the do_walk() function, we previously
always called try_clone(), which duplicates the file handle of the
starting path. However, in most cases, the walk will only use the
starting path to open the next file or directory in the chain, and then
the duplicated file descriptor would be immediately closed again.
To avoid this extra overhead, we can use the MaybeOwned type to pass in
a borrowed reference to the starting path and only clone it in the case
where the starting path is also the final path.
BUG=None
TEST=deploy 9s to device, `ls` shared directory, observe strace output
Change-Id: I15aabc850a3b8b72a9097294a35ab6babfcb0556
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3943529
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>