This implements AsRawDescriptors trait for IrqEdgeEvent and
IrqLevelEvent and updates the users.
BUG=None
TEST=./tools/presubmit
Change-Id: I879531e98396f1eb8e99db73cb00d7b3330101a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3552317
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
The new specialized functions take IrqEdgeEvent and IrqLevelEvent
arguments, so that callers can use them directly.
BUG=None
TEST=./tools/presubmit
Change-Id: I2e5c5d92a6c292f31ad6cfb8652f0c46f0a7a958
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548067
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
The new specialized functions take IrqEdgeEvent and IrqLevelEvent
arguments, so that callers can use them directly.
BUG=None
TEST=./tools/presubmit
Change-Id: I2c1272e31f6b20eb22743b003bd23b9c1105cda6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548066
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
This is in preparation for callers to use IrqEdgeEvent and IrqLevelEvent
and follows general principle in crosvm that if entity needs to hold on
to an event, the entity is responsible for cloning it.
BUG=None
TEST=./tools/presubmit
Change-Id: I9da9a5156108355449b290a2a848257816370fb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548064
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
This allows to make the code more concise and gives callers a chance
to act upon errors.
BUG=None
TEST=./tools/presubmit
Change-Id: Ibd9d53270bc21f90fcb44c673d2c7f3763a44c3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548063
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Splits the vhost-user device into unix & Windows components, and
upstreams the Windows side. Note that we can't build devices on Windows
yet in crosvm because we have to upstream a fair bit more first
(net_util, cros_async, the vmm side of the vhost-user device).
Since net_util isn't upstreamed yet, we've made some very minor changes
to keep things consistent & building on Linux.
TEST=unix is tested by bots upstream & downstream; windows is tested by
bots downstream only.
BUG=b:226233737
Change-Id: Ie3f9818ff93c9e0085a5434055f9dc71c6f6851c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3549854
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Noah Gold <nkgold@google.com>
Now that we have enough infrastructure in place, we can convert
ACPIPMResource to use IrqLevelEvent for both the host (direct) and guest
SCI handling, which makes the code cleaner.
BUG=None
TEST=./tools/presubmit
Change-Id: Ia3c522a9b143b852bf9c34f62a975b670530a82f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548065
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
This replaces the bindgen-based bindings with Rust libc crate types and
constants where possible, so our custom bindings are significantly
reduced.
BUG=b:218388029
TEST=tools/presubmit --quick
Change-Id: I7f20ecf5ccd651456f9a23ce7964fdbd0e8064ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3339851
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This continues conversion from a pair of Event objects to single
IrqLevelEvent.
BUG=None
TEST=./tools/presubmit
Change-Id: Iec7e94f4c40cc29fa612cc3ae364cc6f8b0d0177
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3548061
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Instead of using a separate pair of events in Interrupt structure
convert it to use IrqLevelEvent.
BUG=None
TEST=./tools/presubmit
Change-Id: Ibf0fa69b96de4686fc58a1a431c3a983b7ed4de1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3546575
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
Use IrqLevelEvent instead of 2 separate event for interrupt handling.
BUG=None
TEST=./tools/presubmit
Change-Id: I56e57044b665565cf1b42831e8ac2240e41bd102
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3536894
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
The panic here didn't show what error might be encountered
(EPERM, for instance).
Bug: 228077254
Test: check log on error
Change-Id: I56f34f87430a68266af85ba1d0abb2aeb2c05407
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3569267
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andrew Walbran <qwandor@google.com>
Commit-Queue: Steven Moreland <smoreland@google.com>
As we are going to introduce more media-related crates, reserve the
"media" folder as a placeholder for them, starting with the existing
libvda.
BUG=b:169295147
BUG=b:214478588
TEST=cargo build --features "video-decoder,video-encoder,libvda"
Change-Id: I1b2ec65cbba8b735db3d19845c504546fa1c64ca
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565623
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This was accidentally omitted in the original change. Add some basic
tests to make sure it doesn't regress.
BUG=None
TEST=cargo test -p devices pci_address
Change-Id: Iaedf2357ae02d6203e8296e9765f5ce3bf5bdc84
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3534507
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
As part of the Windows porting effort, the virtio-block device was
changed to only report the VIRTIO_BLK_F_SEG_MAX feature on Linux, since
the maximum number of segments is based on the maximum number of iovec
entries supported by the system as reported by iov_max, which isn't
available on Windows.
Instead, we can support the VIRTIO_BLK_F_SEG_MAX feature everywhere, but
report that only one segment is supported on Windows. This results in
the same effective behavior for the Linux virtio-blk guest driver, which
assumes one segment if the feature is not supported, but it lets us
remove some platform-specific differences in the device and test code.
BUG=b:213149164
TEST=cargo test -p devices block
Change-Id: Id3160b01ee32a2694d40ef6f3d3a286cdb043ea8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3564230
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This adds the asynchronous interrupts in crosvm-gpu for gfxstream.
This will allow gfxstream to alternate between the main signalling
method (ASG [1]) and the more traditional interrupts when it
makes sense performance-wise.
gfxstream also requires new write fence callbacks that take into
account the ring_idx and ctx_id where the fence is on.
[1] goto.google.com/address-space-graphics
BUG=b:192614792
TEST=Tested locally with Vulkan cereal
Change-Id: I010d9ebfc71594b393fee062b984a4c6d69404d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3027489
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
The files include
- coiommu.rs
- msix.rs
- pci_configuration.rs
- pci_root.rs
- pci_bridge.rs
- pvpanic.rs
- stub.rs
Rest of the changes in the patch are supporting changes to build
and test.
Test: presubmit
Bug: b:213149278
Change-Id: Ic8fbcda4ad95370689b232c1656e782ee33425e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3541336
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Instead of handling special conditions by setting a variable and
breaking from the loop into the error handling code, just return the
right error code directly.
BUG=None
TEST=serial console input works.
Change-Id: I02c9b8fd4bc64e4e0f16308d65cd05ace41c5756
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565299
Reviewed-by: Junichi Uekawa <uekawa@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The VvuDevice is now the sole owner of the passed VvuPciDevice. Remove
the Arc<Mutex<>> surrounding it as it has become unnecessary.
BUG=b:194137301
TEST=cargo build
Change-Id: I130a9b8da6b68524aeee784614b690bfc2ac27ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565622
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
The vhost-user vsock device still uses an Option to record whether we
are using VVU or not. Our request handler has a proper type to record
that information, so use it instead. Doing so also allows us to drop a
reference to the VvuPciDevice.
BUG=None
TEST=cargo build
Change-Id: Id952d179758db679f2cd9f739b56d3acda941f69
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565621
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
When using VVU, the DeviceRequestHandler only needs a reference to the
VFIO device, the PCI caps, and the notification events. There is no need
to share a reference to the whole VvuPciDevice, and releasing that
reference will actually allow us to remove it as well as the
VvuPciDevice mutex in a future CL.
BUG=b:194137301
TEST=VVU block device works.
Change-Id: I077c053af8ddefa4b0d624fe6775b5072e843686
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565620
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
This field is not used beyond the constructor and was only stored so it
can be referred by the init() method. Get rid of it by slightly
reorganizing the code.
BUG=b:194137301
TEST=cargo build
Change-Id: I4532a40ef1998ca20fdece9f0f016a36331c2e73
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3565618
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Now that rutabaga users can provide a callback for fence
completion, fences no longer need to be polled on the main thread.
Optional polling still occurs for Rutabaga Components that still
rely on it for other purposes (e.g. virglrenderer for GL query
checking).
Also, use a BTreeMap rather a HashMap since we only expect a dozen
or so entries at most. In such cases, a BTreeMap is faster.
* v1 (lfrb@collabora.com): remove all polling + add async_cb
* v2 (ryanneph@google.com): re-introduce optional polling to fix
virglrenderer that relies on it for GL query checking.
* v3 (ryanneph@google.com): replace timer-based polling with
eventfd-based poll() signaling for components that want to
use it.
BUG=b:175527587
TEST=glxgears and vkcube in a crosvm guest VM.
Cq-Depend: chromium:3555854, chromium:3563893
Change-Id: I8e0181317e954cd15e2b8dc04c9b1329b0a6e182
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2860746
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Ryan Neph <ryanneph@google.com>
Split the creation of the software TPM emulator from the virtio-tpm
device so that other backends can be used with virtio-tpm.
BUG=b:227283268
TEST=cargo build --features=tpm
Change-Id: Ic1ebd2ebd49615201892afbf86cd5be68f6fde8c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3213271
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This CL mainly splits up Window's and Unix code into their own files.
seg_max is now a part of windows, but will always be set to 0
now. seg_max
in virtio_blk_config was being set to 0 on windows anyways.`
Bug: b:213149164
Test: cargo test and presubmit
Change-Id: Icdd481dd8e05c90ac8c1f29773d51312b64d3b2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3553760
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Richard Zhang <rizhang@google.com>
Use our new serde_keyvalue crate to annotate the
VhostVsockDeviceParameter config structure and allow us to create a
vsock device configuration from a key-values string. Add tests to make
sure parsing happens as expected.
Currently the vsock device is configured using the `--cid`,
`--vhost-vsock-fd` and `--vhost-vsock-device` command-line options.
While this CL introduces a way to set the vsock device up with a single
option (an ability we will eventually use), we retain the existing ones
for compatibility reasons.
BUG=b:218223240
TEST=cargo test -p devices vsock::tests::params
TEST=crosvm run with --cid parameter and check that virtio socket device
is present in the output of `lspci`.
Change-Id: Id58beee57f2ada3d2c0d353a430b038bb6c7eef3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3473709
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
When a vfio MSI-X vector got masked by guest, host vfio will release
the corresponding irqfd. Thus host device cannot trigger interrupt
via this fd and we then cannot set the pending bit. What we do instead
is to not release the irqfd but switch the registered kvm irqfd into
a new crosvm irqfd. So that when host device do trigger an interrupt,
crsovm will know about it and set the pending bit accordingly.
BUG=None
TEST=Pass through a nvme disk and tested its functionality.
Change-Id: I81c6fae7b89f1e1a445b8076bd9451a8aa9f0255
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3490239
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
To emulate pending bit for MSI-X, we need to add a new interrupt
delivery path in crosvm. We will make VfioPciWorker share vfio msix
cap with VfioPciDevice, fire interrupt via msix cap when receiving
irq from host device. This makes vfio msix cap shareable.
BUG=None
TEST=./tools/presubmit
Change-Id: I77f5c377a41e7b2bd795e69c1ddcad9a9376f111
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3490238
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Previous vfio's MSI-X emulation lacks per vector masking support. This
patch adds per vector masking for vfio. Now MSI-X vectors are enabled
only if they are currently in use, so host will not allocate extra IRQ
which guest does not use.
BUG=None
TEST=Pass through a nvme disk that uses MSI-X and test its functionality.
Change-Id: If9b3ec907518513d1694b981d94994d8b7e5ea36
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3490237
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
If device does not use all of the MSI vectors, we do not need to
register all for them. This patch pushes the MSI vector registery
to the first time they are enabled.
BUG=None
TEST=./tools/presubmit
Change-Id: I5453e93af4f4f5596d82ad126dc294fa5896846a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3490236
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Use the existing base::open_file function to replace the open-coded
equivalent of file_from_path + File::open fallback.
BUG=None
TEST=tools/presubmit
Change-Id: Ic6190e87056e661be5d552566c466339cefabbfe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3553764
Reviewed-by: Anton Romanov <romanton@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Device want to get notification when a specific gpe happens, this commit
add register_gpe_notify_dev(gpe_num, dev) interface into PmResource trait,
so that others could register (gpe_num, dev) into acpi, then they
could get notification at specific gpe trigger.
BUG=b:185084350
TEST=Verify TBT pcie hotplug function in ManaTEE, virtual pcie root port
must get gpe notification during this process
Change-Id: I56eb90361a6b96be364d35c4b6a5ec598a50757e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3539566
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Currently, VfioPciDevice always use the same BDF as the device's BDF in
the host OS. However, in certain applications (e.g. Borealis), it is
desired to map the device to a different BDF.
This patch introduces a new parameter to `vfio` so that user could set
the device's BDF to a desired address.
BUG=b:208545409
TEST=Boot Borealis with `--vfio=/path/to/dGPU,guest-address=00:11.0` and
confirmed that the dGPU is at 00:11.0 in the guest OS.
Change-Id: I7ee9e9a7f74e3541e74f89d452f9aad45302eeb4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3535461
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Victor Ding <victording@chromium.org>
The vhost-user VMM process is supposed to stop before the device
process, and the device process is supposed to get
`vmm_vhost::Error::ClientExit` when the VMM stops. Add the check in the
existing unit test.
BUG=b:219674197
BUG=b:220639724
TEST=cargo test in /devices/
Change-Id: I1768b9b43855e3b80f1e6e175877317338309e8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3543005
Reviewed-by: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Alexandre Courbot <acourbot@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Keiichi Watanabe <keiichiw@chromium.org>
Add dedicated tracking for mmio bar mmaps. This allows us to remove the
special case handing that ignores writes of 0 and 0xffffffff to the bar
configuration registers. That handling was actually broken because it
used || instead of &&, which resulted in bars being redundantly
remapped.
BUG=none
TEST=Add logs to set_user_memory_region, boot manatee, and check that
the same regions are mapped.
Change-Id: Ic9905330874a4c05f79dbdaee3b40b4d21a488ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3535468
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: David Stevens <stevensd@chromium.org>
Use our new serde_keyvalue crate to annotate the DiskOption structure
and allow us to deserialize it from a key-values string. Add tests to
help ensure parsing won't break in the future.
The existing `root`, `rwroot`, `disk` and `rwdisk` arguments can be
parsed in a compatible manner. In the future it would probably make
sense to merge them all into a single `disk` option since all variants
can now be specified as key-values.
BUG=b:218223240
TEST=crosvm run ... --rwroot /path/to/disk.raw
TEST=cargo test -p devices virtio::block::block::tests::params_from_key_values
Change-Id: I2c8b853b9817aefce0c5f0f5c4d5a1da1f9a45d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3473708
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Use our new serde_keyvalue crate to annotate the SerialParameters
structure and allow us to create it from a key-values string. Add tests
to help ensure parsing doesn't break in the future.
The existing arguments can be parsed identically by this new code, so
replace the old serial options.
BUG=b:218223240
TEST=cargo test -p devices serial_device::tests::params_from_key_values
TEST=cargo test parse_serial
Change-Id: I4898a45399b69b87a44f80d3a214daf081b06173
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3439670
Reviewed-by: Anton Romanov <romanton@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>