Skip to content

Commit

Permalink
CP-40444: Mark VTPM class as prototype
Browse files Browse the repository at this point in the history
Although the module has existed since the Rio release, it doesn't make
sense to state so. This is because until now it was impossible to create
vtpm objects in the database, trying to create one of them resulted in
an exception. This has the added benefit to mark all the parts of the
class to be prototypes and this will make them easier to change before
the feature becomes stable.

Signed-off-by: Pau Ruiz Safont <[email protected]>
  • Loading branch information
psafont committed Aug 30, 2022
1 parent 3ecb5bd commit 9acd4dd
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions ocaml/idl/datamodel_vtpm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,7 @@ let persistence_backend =
Enum ("persistence_backend", [("xapi", "This VTPM is persisted in XAPI's DB")])

let create =
call ~name:"create"
~lifecycle:
[
(Published, rel_rio, "")
; ( Changed
, rel_next
, "Require only a VM reference and uniqueness to create a VTPM instance"
)
]
call ~name:"create" ~lifecycle:[]
~doc:"Create a new VTPM instance, and return its handle."
~params:
[
Expand All @@ -39,20 +31,20 @@ let create =
~allowed_roles:_R_VM_ADMIN ()

let destroy =
call ~name:"destroy" ~lifecycle:[(Published, rel_rio, "")]
call ~name:"destroy" ~lifecycle:[]
~doc:"Destroy the specified VTPM instance, along with its state."
~params:[(Ref _vtpm, "self", "The reference to the VTPM object")]
~allowed_roles:_R_VM_ADMIN ()

let get_contents =
call ~name:"get_contents" ~in_product_since:"rel_next"
~doc:"Obtain the contents of the TPM" ~secret:true
call ~name:"get_contents" ~lifecycle:[] ~doc:"Obtain the contents of the TPM"
~secret:true
~params:[(Ref _vtpm, "self", "The VTPM reference")]
~result:(String, "The contents") ~hide_from_docs:true
~allowed_roles:_R_LOCAL_ROOT_ONLY ()

let set_contents =
call ~name:"set_contents" ~in_product_since:"rel_next"
call ~name:"set_contents" ~lifecycle:[]
~doc:"Introduce new contents for the TPM" ~secret:true
~params:
[
Expand All @@ -63,15 +55,8 @@ let set_contents =

let t =
create_obj ~in_db:true ~in_oss_since:oss_since_303 ~persist:PersistEverything
~lifecycle:
[
(Published, rel_rio, "Added VTPM stub")
; (Extended, rel_next, "Added ability to manipulate contents")
; (Extended, rel_next, "Added VTPM unique and protected properties")
; (Extended, rel_next, "Added Persistence backed")
]
~gen_constructor_destructor:false ~name:_vtpm ~descr:"A virtual TPM device"
~gen_events:true ~doccomments:[]
~lifecycle:[] ~gen_constructor_destructor:false ~name:_vtpm
~descr:"A virtual TPM device" ~gen_events:true ~doccomments:[]
~messages_default_allowed_roles:_R_POOL_ADMIN
~contents:
[
Expand Down

0 comments on commit 9acd4dd

Please sign in to comment.