diff options
Diffstat (limited to 'protos')
-rw-r--r-- | protos/Cargo.toml | 1 | ||||
-rw-r--r-- | protos/build.rs | 2 | ||||
-rw-r--r-- | protos/src/cdisk_spec.proto | 18 | ||||
-rw-r--r-- | protos/src/lib.rs | 3 |
4 files changed, 24 insertions, 0 deletions
diff --git a/protos/Cargo.toml b/protos/Cargo.toml index 9fd0e5a..98cd4ae 100644 --- a/protos/Cargo.toml +++ b/protos/Cargo.toml @@ -6,6 +6,7 @@ edition = "2018" [features] plugin = ["kvm_sys"] +composite-disk = [] trunks = [] [dependencies] diff --git a/protos/build.rs b/protos/build.rs index b510e54..2e870b4 100644 --- a/protos/build.rs +++ b/protos/build.rs @@ -48,6 +48,8 @@ struct LocalProto { static LOCAL_PROTOS: &[LocalProto] = &[ #[cfg(feature = "plugin")] LocalProto { module: "plugin" }, + #[cfg(feature = "composite-disk")] + LocalProto { module: "cdisk_spec" }, ]; fn main() -> Result<()> { diff --git a/protos/src/cdisk_spec.proto b/protos/src/cdisk_spec.proto new file mode 100644 index 0000000..771c7ce --- /dev/null +++ b/protos/src/cdisk_spec.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +enum ReadWriteCapability { + READ_ONLY = 0; + READ_WRITE = 1; +} + +message ComponentDisk { + string file_path = 1; + uint64 offset = 2; + ReadWriteCapability read_write_capability = 3; +} + +message CompositeDisk { + uint64 version = 1; + repeated ComponentDisk component_disks = 2; + uint64 length = 3; +}; diff --git a/protos/src/lib.rs b/protos/src/lib.rs index 3fdbdc0..d73fb03 100644 --- a/protos/src/lib.rs +++ b/protos/src/lib.rs @@ -11,3 +11,6 @@ pub mod plugin; #[cfg(feature = "trunks")] pub use generated::trunks; + +#[cfg(feature = "composite-disk")] +pub use generated::cdisk_spec; |