Command line key=value option parsing helpers

Many command line options take comma-separated key-value pairs. A lot
of the parsing boilerplate is duplicated for various options in
main.rs. This change introduces generic helpers to make this easier.
Subsequent changes will convert the existing option parsing to make
use of this infrastructure.

BUG=b:167947780
TEST=New unit tests.

Change-Id: I5ff1e4a09ac92c10d99b0b81d7d7cd7ce153fadb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3245494
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Mattias Nissler <mnissler@chromium.org>
1 file changed
tree: 75f3e8d48261da00e466054da4858eafd15d5371
  1. .cargo/
  2. .devcontainer/
  3. .github/
  4. aarch64/
  5. acpi_tables/
  6. arch/
  7. assertions/
  8. audio_streams/
  9. base/
  10. bin/
  11. bit_field/
  12. ci/
  13. common/
  14. cros_async/
  15. crosvm_plugin/
  16. data_model/
  17. devices/
  18. disk/
  19. docs/
  20. enumn/
  21. fuse/
  22. fuzz/
  23. gpu_display/
  24. hypervisor/
  25. integration_tests/
  26. io_uring/
  27. kernel_cmdline/
  28. kernel_loader/
  29. kvm/
  30. kvm_sys/
  31. libcras_stub/
  32. libcrosvm_control/
  33. libvda/
  34. linux_input_sys/
  35. net_sys/
  36. net_util/
  37. power_monitor/
  38. protos/
  39. qcow_utils/
  40. resources/
  41. rutabaga_gfx/
  42. seccomp/
  43. src/
  44. sync/
  45. sys_util/
  46. system_api_stub/
  47. tests/
  48. third_party/
  49. tools/
  50. tpm2/
  51. tpm2-sys/
  52. usb_sys/
  53. usb_util/
  54. vfio_sys/
  55. vhost/
  56. virtio_sys/
  57. vm_control/
  58. vm_memory/
  59. x86_64/
  60. .dockerignore
  61. .gitignore
  62. .gitmodules
  63. .rustfmt.toml
  64. ARCHITECTURE.md
  65. Cargo.toml
  66. CONTRIBUTING.md
  67. LICENSE
  68. logo.svg
  69. navbar.md
  70. OWNERS
  71. README.md
  72. run_tests
  73. rust-toolchain
  74. setup_cros_cargo.sh
  75. test_all
  76. unblocked_terms.txt
README.md

crosvm - The Chrome OS Virtual Machine Monitor

Logo

crosvm is a virtual machine monitor (VMM) based on Linux’s KVM hypervisor, with a focus on simplicity, security, and speed. crosvm is intended to run Linux guests, originally as a security boundary for running native applications on the Chrome OS platform. Compared to QEMU, crosvm doesn’t emulate architectures or real hardware, instead concentrating on paravirtualized devies, such as the virtio standard.

crosvm is currently used to run Linux/Android guests on Chrome OS devices.