Skip to content

Commit

Permalink
Merge pull request #5562 from MarkSymsCtx/CP-47991
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont authored Apr 16, 2024
2 parents 5b59bc6 + eb5d0fe commit 9bc4c1f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ocaml/xapi-storage/generator/lib/control.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ type health =
(** Storage is busy recovering, e.g. rebuilding mirrors *)
[@@deriving rpcty]

type volume_type =
| Data (** Normal data volume *)
| CBT_Metadata (** CBT Metadata only, data destroyed *)
| Data_and_CBT_Metadata (** Both Data and CBT Metadata *)
[@@deriving rpcty]

(** Primary key for a specific Storage Repository. This can be any string
which is meaningful to the implementation. For example this could be an
NFS directory name, an LVM VG name or even a URI. This string is
Expand Down Expand Up @@ -116,6 +122,11 @@ type volume = {
; keys: (string * string) list
(** A list of key=value pairs which have been stored in the Volume
metadata. These should not be interpreted by the Volume plugin. *)
; volume_type: volume_type option [@default Some Data]
(** The content type of this volume *)
; cbt_enabled: bool option [@default Some false]
(** True means that the storage datapath will track changed dirty blocks
while writing and will be able to provide CBT Metadata when requested *)
}
[@@deriving rpcty]

Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-storage/generator/test/storage_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ let test_volume =
; physical_utilisation= 0L
; uri= ["uri1"]
; keys= []
; cbt_enabled= Some false
; volume_type= Some Data
}

(** Check that we successfully parse the responses and
Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-storage/rpc-light/SR.ls/response
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
<member><name>physical_utilisation</name><value>0</value></member>
<member><name>uri</name><value><array><data><value>uri1</value></data></array></value></member>
<member><name>keys</name><value><struct></struct></value></member>
<member><name>volume_type</name><value>Data</value></member>
<member><name>cbt_enabled</name><value>false</value></member>
</struct></value></data>
</array></value></member>
</struct></value></param></params>
Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-storage/rpc-light/Volume.clone/response
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<member><name>physical_utilisation</name><value>0</value></member>
<member><name>uri</name><value><array><data><value>uri1</value></data></array></value></member>
<member><name>keys</name><value><struct></struct></value></member>
<member><name>volume_type</name><value>Data</value></member>
<member><name>cbt_enabled</name><value>false</value></member>
</struct>
</value></member>
</struct></value></param>
Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-storage/rpc-light/Volume.create/response
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<member><name>physical_utilisation</name><value>0</value></member>
<member><name>uri</name><value><array><data><value>uri1</value></data></array></value></member>
<member><name>keys</name><value><struct></struct></value></member>
<member><name>volume_type</name><value>Data</value></member>
<member><name>cbt_enabled</name><value>false</value></member>
</struct>
</value></member>
</struct></value></param>
Expand Down
2 changes: 2 additions & 0 deletions ocaml/xapi-storage/rpc-light/Volume.snapshot/response
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<member><name>physical_utilisation</name><value>0</value></member>
<member><name>uri</name><value><array><data><value>uri1</value></data></array></value></member>
<member><name>keys</name><value><struct></struct></value></member>
<member><name>volume_type</name><value>Data</value></member>
<member><name>cbt_enabled</name><value>false</value></member>
</struct>
</value></member>
</struct></value></param>
Expand Down

0 comments on commit 9bc4c1f

Please sign in to comment.