Commit graph

4 commits

Author SHA1 Message Date
Cody Schuffelen
f9b035d50c Support composite disks.
This adds a new disk file type next to raw files and qcow images that
represent an indirection to further raw disk files. The disk file
itself is a proto file with references to file paths for other disks to
open and their virtual offsets and lengths.

The intention is to make it easy to assemble a single virtual hard disk
out of several distinct partition files. In the particular case of
Cuttlefish running Android in a VM, this is relevant as the Android
build system distributes partitions as separate raw files. While the
simple solution is to pass each partition as a separate raw disk, some
functionality (like the bootloader) assumes there is a partition table
with multiple distinct partitions on a single disk.

Implementing composite disk support in the VMM bridges this gap through
supporting the general-purpose case of a disk built out of multiple
component files.

If desired, this can be extended to support qcow files to support
unusual configurations like a mixed qcow/raw disk.

Enabled with the "composite-disk" feature.

Bug: b/133432409
Change-Id: I2b0c47d92fab13b5dc0ca5a960c7cfd2b7145b87
Signed-off-by: Cody Schuffelen <schuffelen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/1667767
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
2019-10-03 00:59:14 +00:00
David Tolnay
b1de6323ab clippy: Suppress warning from protoc_rust generated code
Protoc_rust emits this into every file it generates:

    #![cfg_attr(feature = "cargo-clippy", allow(clippy))]

which is the old style of tool attribute. It is deprecated in favor of
actual tool attributes that stabilized in rust 1.31.

    #![allow(clippy::all)]

Without this PR, the warning when running bin/clippy looks like:

    warning: lint name `clippy` is deprecated and may not have an effect in the future.
     --> /chromiumos/src/platform/crosvm/target/debug/build/protos/out/trunks/interface.rs:6:10
      |
    6 | #![cfg_attr(feature = "cargo-clippy", allow(clippy))]
      |                                             ^^^^^^
      |
      = note: #[warn(renamed_and_removed_lints)] on by default

TEST=bin/clippy

Change-Id: I1a484379a8f53d76d3667590cd8458588492d2b1
Reviewed-on: https://chromium-review.googlesource.com/1567849
Commit-Ready: David Tolnay <dtolnay@chromium.org>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-04-17 17:23:11 -07:00
David Tolnay
65928af6c9 protos: Merge plugin_proto crate under protos::plugin
This de-duplicates the two separate build.rs files dealing with proto
compilation. The trunks interface.proto will be exposed under
protos::trunks and the plugin proto will be exposed under protos::plugin.

BUG=none
TEST=cargo check
TEST=cargo check --features tpm
TEST=cargo check --features plugin
TEST=cargo check --features tpm,plugin
TEST=FEATURES=test emerge-nami crosvm
TEST=FEATURES=test USE=crosvm-tpm emerge-nami crosvm
TEST=FEATURES=test USE=crosvm-plugin emerge-nami crosvm
TEST=FEATURES=test USE='crosvm-tpm crosvm-plugin' emerge-nami crosvm
TEST=local kokoro
CQ-DEPEND=CL:1553971

Change-Id: I203b654a38e9d671a508156ae06dfb6f70047c4f
Reviewed-on: https://chromium-review.googlesource.com/1556417
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-04-12 14:49:57 -07:00
David Tolnay
1aca8b7269 protos: Compile protos for trunks daemon
The TPM device will need these protos to communicate TPM commands to the
Trunks daemon and receive TPM responses.

BUG=chromium:911799
TEST=cargo check
TEST=cargo check --features tpm
TEST=FEATURES=test emerge-nami crosvm
TEST=FEATURES=test USE=crosvm-tpm emerge-nami crosvm
TEST=local kokoro
CQ-DEPEND=CL:1553610
CQ-DEPEND=CL:1553971

Change-Id: I1a67a7b4a3714236b20a790068ca19129446f71c
Reviewed-on: https://chromium-review.googlesource.com/1554982
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: David Tolnay <dtolnay@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: David Tolnay <dtolnay@chromium.org>
Reviewed-by: Zach Reizner <zachr@chromium.org>
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
2019-04-12 14:49:56 -07:00