-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce VTPM for guests #4780
Merged
Merged
Changes from all commits
Commits
Show all changes
75 commits
Select commit
Hold shift + click to select a range
1b1fd45
CP-38617: Add module with stubs for xenforeignmemory
psafont 3d1a2e7
Add a test executable that works against the bindings
psafont afa0daf
Merge pull request #4633 from psafont/private/paus/xen-foreign
psafont 4a77bef
CP-38626: move vtpm module to its own file
psafont c350afc
CP-38626: Allow manipulation of VTPM contents
psafont 525259f
CP-38626: expose vtpm objects through xe cli
psafont 22b8dda
Merge pull request #4644 from psafont/private/paus/vtpm-datamodel
psafont 8986868
Merge branch 'master' into private/paus/vtpm-update
psafont 6d675e4
Merge pull request #4649 from psafont/private/paus/vtpm-update
psafont ca755ae
Merge remote-tracking branch 'origin/master' into feature/vtpm
edwintorok 9e279f6
Merge remote-tracking branch 'origin/master' into feature/vtpm
edwintorok 6f448be
Maintenance: update quality gate after merge
edwintorok 1a5be17
Merge pull request #4671 from edwintorok/feature/vtpm
edwintorok 79576d5
CP-38554: functorize varstored sandbox code
psafont 2783369
CP-39441: Enable xenopsd to directly wait on pid creation
psafont 9b52389
CP-38554: Start up and stop SWTPM and guard for every domain
psafont 27f2799
xenops_sandbox: use create instead of prepare
psafont 66e2aa1
Merge pull request #4667 from psafont/private/paus/swtpm-managed
edwintorok 1ed27f8
CP-39414: start swtpm depending on the VM's platform metadata
psafont d083048
CP-39414: log actual daemon name when deleting sandbox
psafont 8dbc71e
CP-39574: Create and destroy VTPM objects attached to VMs
psafont 1dd5bbd
Merge branch 'master' into feature/vtpm
psafont ef96b22
Merge pull request #4723 from psafont/private/paus/vtpm-merged
psafont b2ce504
Merge branch 'feature/vtpm' into private/paus/vtpm-param
edwintorok c249fa5
Merge pull request #4693 from psafont/private/paus/vtpm-param
edwintorok 7ee7e33
maintenance: post-merge fixes
psafont 4ff283a
xapi-idl: move Uuidm type to separate module
edwintorok 3833d10
xapi-idl: add sexp converter to Uuidm type
edwintorok a8dec3a
vTPM: plumb through Uuid
edwintorok 4e5597e
varstore-guard: add filtering for vTPM.{set,get}_contents API
edwintorok 875da36
vTPM: add minimal support for saving/restoring state through the XAPI DB
edwintorok 43baa4a
vTPM: add minimal migration support
edwintorok cca5ac7
vTPM: do not hardcode swtpm-wrapper path
edwintorok cb6161f
Merge pull request #4730 from edwintorok/private/edvint/vtpm-state-me…
psafont d72b680
CP-40032: Block VTPM creation and destruction on certain cases
psafont b9c99ef
CP-40032: add vtpm-create and destroy to cli
psafont 66dc6a0
CA-368102: Send the VTPM uuid to xenops whenever its available
psafont bfcde2a
Merge pull request #4740 from psafont/private/paus/vtpm-create
psafont 5ff4c2f
xenops_sandbox: only get references by creating the sandbox
psafont 9c2dc9a
CP-39894: move xenopsd's daemon modules from device to service
psafont c516727
xenopsd/xc/service: add licensing header
psafont 500bbab
CP-39894: Move all swtpm starting code to service module
psafont 816d4ab
CP-39894: move all varstored starting code to service module
psafont baccccd
CP-39894: move vgpu starting code to service module
psafont 5caee44
CP-39894: Replace is_pidfile and pid_path with pid_location
psafont 5a6d61a
CP-39894: tweak Service.Qemu interface
psafont 6173e09
CP-39894: Use pid_location for file and xenstore cleanups
psafont 584bf46
CP-39894: Add Pid.File and use it in Swtpm
psafont 6e4a3ca
CA-366479: Remove Qemu's pidfile on domain shutdown
psafont d0c9a18
Merge pull request #4720 from psafont/private/paus/pid-wait
psafont 1fc0f1a
Merge branch 'master' into vtpm-merge
psafont 053d602
Merge pull request #4747 from psafont/vtpm-merge
psafont 684b76c
CA-368106: Do not encode vtpm contents twice
psafont 6965944
CA-368231: Require only a VM reference for vtpm-create
psafont b2c86cb
CA-368231: change role for creating and destroying VTPMs
psafont e6ae94b
CP-39136: Reintroduce backends for VTPMs
psafont 48817f6
idl: enable events for vtpm objects
psafont d79a445
CP-40087: replace vtpm profile with individual fields
psafont ffd9ca8
vtpm: allow the lifecycle of the vtpm contents to be autogenerated
psafont 8792bca
db_upgrade: use module name for debug messages
psafont c2cdf85
database: use accurate message when a field lacks a default on update
psafont dc556b6
Merge pull request #4752 from psafont/private/paus/b128
psafont b2ae0c4
maintenance: comment whitespace
psafont 19ce597
CP-39850: Copy VTPM on clone
psafont 191ae1f
CP-39850: Block live snapshots for VMs with vTPM
psafont 56cd793
Merge pull request #4771 from psafont/private/paus/tpm-clone
psafont b059fd3
CP-40284: Gate VTPM creation behind an experimental feature
psafont ea90f23
CP-39874: Prevent VTPMs and HA from coexisting
psafont 97b958c
CP-40087: Display the correct names of VTPM profiles in the CLI
psafont cdef724
Merge pull request #4774 from psafont/private/paus/tpm_flag
psafont 4a9614c
Merge branch 'master' into private/paus/merge-master-vtpm
psafont ed51796
Merge pull request #4778 from psafont/private/paus/merge-master-vtpm
psafont 3ecb5bd
CP-40444: Add swtpm-wrapper to the repository
psafont 9acd4dd
CP-40444: Mark VTPM class as prototype
psafont 7b8e0f2
CP-40672: set platform/tpm_version xenstore key on vm construction
psafont File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
(* | ||
Copyright (C) Citrix Systems Inc. | ||
|
||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU Lesser General Public License as published | ||
by the Free Software Foundation; version 2.1 only. with the special | ||
exception on linking described in file LICENSE. | ||
|
||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Lesser General Public License for more details. | ||
*) | ||
|
||
open Datamodel_types | ||
open Datamodel_common | ||
open Datamodel_roles | ||
|
||
let persistence_backend = | ||
Enum ("persistence_backend", [("xapi", "This VTPM is persisted in XAPI's DB")]) | ||
|
||
let create = | ||
call ~name:"create" ~lifecycle:[] | ||
~doc:"Create a new VTPM instance, and return its handle." | ||
~params: | ||
[ | ||
(Ref _vm, "vM", "The VM reference the VTPM will be attached to") | ||
; (Bool, "is_unique", "Whether the VTPM must be unique") | ||
] | ||
~result:(Ref _vtpm, "The reference of the newly created VTPM") | ||
~allowed_roles:_R_VM_ADMIN () | ||
|
||
let destroy = | ||
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" ~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" ~lifecycle:[] | ||
~doc:"Introduce new contents for the TPM" ~secret:true | ||
~params: | ||
[ | ||
(Ref _vtpm, "self", "The VTPM reference") | ||
; (String, "contents", "The new contents") | ||
] | ||
~hide_from_docs:true ~allowed_roles:_R_LOCAL_ROOT_ONLY () | ||
|
||
let t = | ||
create_obj ~in_db:true ~in_oss_since:oss_since_303 ~persist:PersistEverything | ||
~lifecycle:[] ~gen_constructor_destructor:false ~name:_vtpm | ||
~descr:"A virtual TPM device" ~gen_events:true ~doccomments:[] | ||
~messages_default_allowed_roles:_R_POOL_ADMIN | ||
~contents: | ||
[ | ||
uid _vtpm | ||
; field ~qualifier:StaticRO ~ty:(Ref _vm) "VM" | ||
"The virtual machine the TPM is attached to" | ||
; field ~qualifier:DynamicRO ~ty:(Ref _vm) "backend" | ||
~default_value:(Some (VRef null_ref)) | ||
"The domain where the backend is located (unused)" | ||
; field ~qualifier:DynamicRO ~ty:persistence_backend | ||
~default_value:(Some (VEnum "xapi")) ~lifecycle:[] | ||
"persistence_backend" "The backend where the vTPM is persisted" | ||
; field ~qualifier:StaticRO ~ty:Bool ~default_value:(Some (VBool false)) | ||
~lifecycle:[] "is_unique" | ||
"Whether the contents are never copied, satisfying the TPM spec" | ||
; field ~qualifier:DynamicRO ~ty:Bool ~default_value:(Some (VBool false)) | ||
~lifecycle:[] "is_protected" | ||
"Whether the contents of the VTPM are secured according to the TPM \ | ||
spec" | ||
; field ~qualifier:DynamicRO ~ty:(Ref _secret) ~internal_only:true | ||
~lifecycle:[] "contents" "The contents of the TPM" | ||
] | ||
~messages:[create; destroy; get_contents; set_contents] | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And now it has been changed away from 'xapi' deliberately? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spelunked and found no justification for it in the commit that introduced the module. It's more helpful to have the actual module that prints the loglines, same reasoning I used to change all the unjustified ones 3 years back, it just helps whith triaging