Skip to content

Commit

Permalink
CP-40672: set platform/tpm_version xenstore key on vm construction
Browse files Browse the repository at this point in the history
This allows hvmloader to load the correct acpi table for guests using
tpm, while retaining the previous acpi table for existing guests

Signed-off-by: Pau Ruiz Safont <[email protected]>
  • Loading branch information
psafont committed Sep 8, 2022
1 parent 9acd4dd commit 7b8e0f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ocaml/xapi/vm_platform.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ let nested_virt = "nested-virt"

let vcpu_unrestricted = "vcpu-unrestricted"

let tpm_version = "tpm_version"

(* The default value of device model should be set as
'qemu-trad', 'qemu-upstream-compat', 'qemu-upstream' according to QEMU-upstream feature release stages *)
let fallback_device_model_stage_1 = "qemu-trad"
Expand Down
9 changes: 9 additions & 0 deletions ocaml/xapi/xapi_xenops.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,15 @@ module MD = struct
else
platformdata
in
(* Add TPM version 2 iff there's a tpm attached to the VM, this allows
hvmloader to load the TPM 2.0 ACPI table while maintaing the current
ACPI table for other guests *)
let platformdata =
if vm.API.vM_VTPMs <> [] || bool vm.API.vM_platform false "vtpm" then
(Vm_platform.tpm_version, "2") :: platformdata
else
platformdata
in
let pci_msitranslate = true in
(* default setting *)
(* CA-55754: allow VM.other_config:msitranslate to override the bus-wide setting *)
Expand Down

0 comments on commit 7b8e0f2

Please sign in to comment.