From 0826ad3838b51fdf352ff34158a97bb28498c957 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Wed, 7 Jan 2026 20:07:29 -0600 Subject: [PATCH 01/17] Add Trusted Computing Module (TPM) support Signed-off-by: Jerone Young jyoung@redhat.com --- lib/fog/libvirt/compute.rb | 1 + lib/fog/libvirt/models/compute/server.rb | 31 ++++++++ lib/fog/libvirt/models/compute/tpm.rb | 90 ++++++++++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 lib/fog/libvirt/models/compute/tpm.rb diff --git a/lib/fog/libvirt/compute.rb b/lib/fog/libvirt/compute.rb index 14f6c20..c12f579 100644 --- a/lib/fog/libvirt/compute.rb +++ b/lib/fog/libvirt/compute.rb @@ -22,6 +22,7 @@ class Compute < Fog::Service collection :nodes model :nic collection :nics + model :tpm request_path 'fog/libvirt/requests/compute' request :list_domains diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index 805898f..d691b70 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -36,6 +36,8 @@ class Server < Fog::Compute::Server attribute :guest_agent attribute :video attribute :virtio_rng + attribute :tpm + attribute :tpm_device attribute :state @@ -58,6 +60,7 @@ def initialize(attributes={} ) super defaults.merge(attributes) initialize_nics initialize_volumes + initialize_tpm @user_data = attributes.delete(:user_data) end @@ -411,6 +414,27 @@ def to_xml xml.backend(virtio_rng[:backend_path], :model => virtio_rng.fetch(:backend_model, "random")) end + if tpm[:enable] + if tpm_device.model == "spapr-tpm-proxy" + tpm_model_type = "spapr-tpm-proxy" + else + tpm_model_type = "tpm-#{tpm_device.model}" + end + + xml.tpm(:model => tpm_model_type) do + if tpm_device.type == "passthrough" + xml.backend(:type => tpm_device.type) do + xml.device(:path => tpm_device.passthrough_device_path) + end + else + xml.backend(:type => tpm_device.type, :version => tpm_device.version) + end + if tpm_device.model == "spapr" || tpm_device.model == "spapr-tpm-proxy" + xml.address(:type => tpm_device.par_address_type, :reg => tpm_device.spar_address_reg) + end + end + end + if arch == "s390x" xml.controller(:type => "scsi", :index => "0", :model => "virtio-scsi") xml.console(:type => "pty") do @@ -504,6 +528,12 @@ def initialize_volumes end end + def initialize_tpm + if tpm[:enable] + self.tpm_device = TPM.new(tpm, arch) + end + end + def create_or_clone_volume options = {:name => volume_name || default_volume_name} # Check if a disk template was specified @@ -561,6 +591,7 @@ def defaults :video => {:type => "virtio", :heads => 1}, :virtio_rng => {}, :firmware_features => { "secure-boot" => "no" }, + :tpm => {:enable => false, :id => "tpm0"} } end diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb new file mode 100644 index 0000000..4c71c46 --- /dev/null +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -0,0 +1,90 @@ +require 'fog/core/model' + +module Fog + module Libvirt + class Compute + class TPM < Fog::Model + # Currently Qemu only allows for one TPM device + + identity :id + attribute :arch + attribute :model + attribute :type + attribute :version + attribute :device_path + attribute :spapr_address_type + attribute :spapr_address_reg + + # Types + # + TYPES = ['emulator', 'passthrough'].freeze + + # Models + # crb - TCG PC Client Platform TPM Profile (PTP) Specification (2017) + # tis - TCG PC Client Specific TPM Interface Specification (TIS) (2013) + # spapr - Used with pSeries (ppc64) + # spapr-tpm-proxy - Used with pSeries (ppc64), this is only used with 'passthrough' type + # + MODELS_X86_64 = ['crb', 'tis'].freeze + MODELS_PPC64 = ['spapr', 'spapr-tpm-proxy'].freeze + MODELS_ARM64 = ['tis'].freeze + + # Versions + # + VERSIONS = ['1.2', '2.0'].freeze + + def initialize(attributes = {}, arch = "") + @arch = arch + super defaults.merge(attributes) + raise Fog::Errors::Error.new("#{type} is not a supported TPM type") if new? && !TYPES.include?(type) + raise Fog::Errors::Error.new("#{model} is not a supported TPM model") if new? && !supported_models.include?(model) + end + + def new? + id.nil? + end + + def save + raise Fog::Errors::Error.new('Creating a new TPM device is not yet implemented. Contributions welcome!') + end + + def destroy + raise Fog::Errors::Error.new('Destroying a TPM device is not yet implemented. Contributions welcome!') + end + + def supported_models + case @arch + when "x86_64" + MODELS_X86_64 + when "ppc64" + MODELS_PPC64 + when "arm64" || "aarch64" + MODELS_ARM64 + else + raise Fog::Errors::Error.new('CPU Architecture does not have any supported TPM models!') + end + end + + def defaults + case @arch + when "x86_64" + { :model => "crb", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } + when "ppc64" + { + :model => "spapr", + :type => "emulator", + :version => "2.0", + :passthrough_device_path => "/dev/tpmrm0", + :spapr_address_type => "spapr-vio", + :spapr_address_reg => "0x00004000" + } + when "arm64" || "aarch64" + { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } + else + {} + end + end + end + end + end +end \ No newline at end of file From 95bd13f60c325a956a18b4c6740ffb44a4b46e88 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Wed, 7 Jan 2026 20:29:09 -0600 Subject: [PATCH 02/17] Remove unneeded space in conditional in server.rb There was an unneeded space in the conditional. Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index d691b70..2303e03 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -429,7 +429,7 @@ def to_xml else xml.backend(:type => tpm_device.type, :version => tpm_device.version) end - if tpm_device.model == "spapr" || tpm_device.model == "spapr-tpm-proxy" + if tpm_device.model == "spapr" || tpm_device.model == "spapr-tpm-proxy" xml.address(:type => tpm_device.par_address_type, :reg => tpm_device.spar_address_reg) end end From bafbfc911bf34383287442ba69880b0c3ada88af Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Sat, 10 Jan 2026 23:10:10 -0600 Subject: [PATCH 03/17] Fix ARM designation & Add ppc64le Fix designation of ARM architecture and add ppc64le. Signed-off-by: Jerone Young "crb", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } - when "ppc64" + when "ppc64" || "ppc64le" { :model => "spapr", :type => "emulator", @@ -78,7 +78,7 @@ def defaults :spapr_address_type => "spapr-vio", :spapr_address_reg => "0x00004000" } - when "arm64" || "aarch64" + when "arm" || "aarch64" { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } else {} @@ -87,4 +87,4 @@ def defaults end end end -end \ No newline at end of file +end From 7dc9085f56420bbddb1dfc0c1de38908ed8c898b Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Sat, 10 Jan 2026 23:23:49 -0600 Subject: [PATCH 04/17] Add s390x support Add s390x support Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index 49469b8..ac386cb 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -28,6 +28,7 @@ class TPM < Fog::Model MODELS_X86_64 = ['crb', 'tis'].freeze MODELS_PPC64 = ['spapr', 'spapr-tpm-proxy'].freeze MODELS_ARM64 = ['tis'].freeze + MODELS_S390X = ['tis'].freeze # Versions # @@ -60,6 +61,8 @@ def supported_models MODELS_PPC64 when "arm" || "aarch64" MODELS_ARM64 + when "s390x" + MODELS_S390X else raise Fog::Errors::Error.new('CPU Architecture does not have any supported TPM models!') end @@ -80,6 +83,8 @@ def defaults } when "arm" || "aarch64" { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } + when "s390x" + { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } else {} end From bccb8526fb3bb550a56cfc73173bdccf09e80314 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 05:39:52 -0600 Subject: [PATCH 05/17] Fix conditional & change argument order when creating new TPM object Fix conditional & change argument order when creating new TPM object Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index 2303e03..5f9beba 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -415,12 +415,8 @@ def to_xml end if tpm[:enable] - if tpm_device.model == "spapr-tpm-proxy" - tpm_model_type = "spapr-tpm-proxy" - else - tpm_model_type = "tpm-#{tpm_device.model}" - end - + tpm_model_type = (tpm_device.model == "spapr-tpm-proxy") ? "spapr-tpm-proxy" : "tpm-#{tpm_device.model}" + xml.tpm(:model => tpm_model_type) do if tpm_device.type == "passthrough" xml.backend(:type => tpm_device.type) do @@ -530,7 +526,7 @@ def initialize_volumes def initialize_tpm if tpm[:enable] - self.tpm_device = TPM.new(tpm, arch) + self.tpm_device = TPM.new(arch, tpm) end end From 83f2d5a547bd08a55005c4272aea6b465dd982f2 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 05:44:42 -0600 Subject: [PATCH 06/17] Redo argument initialization order and fix error calls. Fix argument initialization order and fix error calls Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index ac386cb..a6a1e07 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -34,11 +34,11 @@ class TPM < Fog::Model # VERSIONS = ['1.2', '2.0'].freeze - def initialize(attributes = {}, arch = "") + def initialize(arch = "", attributes = {}) @arch = arch super defaults.merge(attributes) - raise Fog::Errors::Error.new("#{type} is not a supported TPM type") if new? && !TYPES.include?(type) - raise Fog::Errors::Error.new("#{model} is not a supported TPM model") if new? && !supported_models.include?(model) + raise Fog::Errors::Error, "#{type} is not a supported TPM type" if new? && !TYPES.include?(type) + raise Fog::Errors::Error, "#{model} is not a supported TPM model" if new? && !supported_models.include?(model) end def new? @@ -46,11 +46,11 @@ def new? end def save - raise Fog::Errors::Error.new('Creating a new TPM device is not yet implemented. Contributions welcome!') + raise Fog::Errors::Error, 'Creating a new TPM device is not yet implemented. Contributions welcome!' end def destroy - raise Fog::Errors::Error.new('Destroying a TPM device is not yet implemented. Contributions welcome!') + raise Fog::Errors::Error. 'Destroying a TPM device is not yet implemented. Contributions welcome!' end def supported_models @@ -64,7 +64,7 @@ def supported_models when "s390x" MODELS_S390X else - raise Fog::Errors::Error.new('CPU Architecture does not have any supported TPM models!') + raise Fog::Errors::Error 'CPU Architecture does not have any supported TPM models!' end end From ae9378b656066923bc44521431706ac937c15a23 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 05:48:08 -0600 Subject: [PATCH 07/17] Fix errors in error calls Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index a6a1e07..789cb9b 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -50,7 +50,7 @@ def save end def destroy - raise Fog::Errors::Error. 'Destroying a TPM device is not yet implemented. Contributions welcome!' + raise Fog::Errors::Error, 'Destroying a TPM device is not yet implemented. Contributions welcome!' end def supported_models @@ -64,7 +64,7 @@ def supported_models when "s390x" MODELS_S390X else - raise Fog::Errors::Error 'CPU Architecture does not have any supported TPM models!' + raise Fog::Errors::Error, 'CPU Architecture does not have any supported TPM models!' end end From 87fc64d2fae1a32c9a1b04cd8a4462975b64c54a Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 05:56:14 -0600 Subject: [PATCH 08/17] Convert conditional & fix trailing white space Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index 5f9beba..a3053d0 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -416,7 +416,6 @@ def to_xml if tpm[:enable] tpm_model_type = (tpm_device.model == "spapr-tpm-proxy") ? "spapr-tpm-proxy" : "tpm-#{tpm_device.model}" - xml.tpm(:model => tpm_model_type) do if tpm_device.type == "passthrough" xml.backend(:type => tpm_device.type) do @@ -425,7 +424,7 @@ def to_xml else xml.backend(:type => tpm_device.type, :version => tpm_device.version) end - if tpm_device.model == "spapr" || tpm_device.model == "spapr-tpm-proxy" + if %w[spapr spapr-tpm-proxy].include?(tpm_device.model) xml.address(:type => tpm_device.par_address_type, :reg => tpm_device.spar_address_reg) end end From bc256e1e5dd8bbe4568d6cb8e1b7e06a2603b226 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 06:05:54 -0600 Subject: [PATCH 09/17] Set id during initalization Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index 789cb9b..b2a5643 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -35,6 +35,7 @@ class TPM < Fog::Model VERSIONS = ['1.2', '2.0'].freeze def initialize(arch = "", attributes = {}) + @id = "tpm0" @arch = arch super defaults.merge(attributes) raise Fog::Errors::Error, "#{type} is not a supported TPM type" if new? && !TYPES.include?(type) From 625282438d45d15dcc2dba583f5e83ee10c4b184 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 06:07:04 -0600 Subject: [PATCH 10/17] Remove tpm id from defaults Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index a3053d0..65b3f30 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -586,7 +586,7 @@ def defaults :video => {:type => "virtio", :heads => 1}, :virtio_rng => {}, :firmware_features => { "secure-boot" => "no" }, - :tpm => {:enable => false, :id => "tpm0"} + :tpm => {:enable => false} } end From eda78c251d1bc2d173011419e97009b3a651ff91 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 06:12:25 -0600 Subject: [PATCH 11/17] Update to check existence of tpm_device instead of tpm[:enable] Signed-off-by: Jerone Young Co-authored-by: Ewoud Kohl van Wijngaarden --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index 65b3f30..e9a6741 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -414,7 +414,7 @@ def to_xml xml.backend(virtio_rng[:backend_path], :model => virtio_rng.fetch(:backend_model, "random")) end - if tpm[:enable] + if tpm_device tpm_model_type = (tpm_device.model == "spapr-tpm-proxy") ? "spapr-tpm-proxy" : "tpm-#{tpm_device.model}" xml.tpm(:model => tpm_model_type) do if tpm_device.type == "passthrough" From d0b8afb01f8e62eade6750b00f17e2771c5e2f69 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 06:32:08 -0600 Subject: [PATCH 12/17] Fix ternary operation to match coding style Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index e9a6741..f1fb697 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -415,7 +415,7 @@ def to_xml end if tpm_device - tpm_model_type = (tpm_device.model == "spapr-tpm-proxy") ? "spapr-tpm-proxy" : "tpm-#{tpm_device.model}" + tpm_model_type = tpm_device.model == "spapr-tpm-proxy" ? "spapr-tpm-proxy" : "tpm-#{tpm_device.model}" xml.tpm(:model => tpm_model_type) do if tpm_device.type == "passthrough" xml.backend(:type => tpm_device.type) do From 003a5ac9c5721dca34810bc3f7577a75382c8437 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 13:56:31 -0600 Subject: [PATCH 13/17] Convert tpm to be value that can be boolean or hash value Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index f1fb697..c21d1cc 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -524,7 +524,12 @@ def initialize_volumes end def initialize_tpm - if tpm[:enable] + # tpm can be a boolean or hash + if tpm + # convert tpm to empty hash not hash value + if !tpm.is_a?(Hash) + tpm = {} + end self.tpm_device = TPM.new(arch, tpm) end end @@ -586,7 +591,7 @@ def defaults :video => {:type => "virtio", :heads => 1}, :virtio_rng => {}, :firmware_features => { "secure-boot" => "no" }, - :tpm => {:enable => false} + :tpm => false } end From 6e9a84d608c391435f703361e2b0c5db7cf7ef93 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 14:15:38 -0600 Subject: [PATCH 14/17] Fix comment on conversion of tpm if not a hash value Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/server.rb b/lib/fog/libvirt/models/compute/server.rb index c21d1cc..8aab3e6 100644 --- a/lib/fog/libvirt/models/compute/server.rb +++ b/lib/fog/libvirt/models/compute/server.rb @@ -526,7 +526,7 @@ def initialize_volumes def initialize_tpm # tpm can be a boolean or hash if tpm - # convert tpm to empty hash not hash value + # convert tpm to empty hash if not a hash value if !tpm.is_a?(Hash) tpm = {} end From aeea352812ce2ef4955a94e795fb217087b9e3a1 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 14:43:37 -0600 Subject: [PATCH 15/17] Set ppc64 default for passthrough device to tpm0 By default change ppc64 to tpm0. As tpmrm0 is to be used by spapr-tpm-proxy and not spapr in case of using passthrough option. Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index b2a5643..9c947a7 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -78,7 +78,7 @@ def defaults :model => "spapr", :type => "emulator", :version => "2.0", - :passthrough_device_path => "/dev/tpmrm0", + :passthrough_device_path => "/dev/tpm0", :spapr_address_type => "spapr-vio", :spapr_address_reg => "0x00004000" } From 7473016fc754b1ed466dddff8abc3eaff793d387 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Mon, 12 Jan 2026 15:08:26 -0600 Subject: [PATCH 16/17] Add support for ARM/aarch64 in big-endian mode Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index 9c947a7..995810a 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -60,7 +60,7 @@ def supported_models MODELS_X86_64 when "ppc64" || "ppc64le" MODELS_PPC64 - when "arm" || "aarch64" + when "arm" || "aarch64" || "aarch64_be" MODELS_ARM64 when "s390x" MODELS_S390X @@ -82,7 +82,7 @@ def defaults :spapr_address_type => "spapr-vio", :spapr_address_reg => "0x00004000" } - when "arm" || "aarch64" + when "arm" || "aarch64" || "aarch64_be" { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } when "s390x" { :model => "tis", :type => "emulator", :version => "2.0", :passthrough_device_path => "/dev/tpm0" } From d48a77b3d1d84ad7e9a19f422c7ca0e005e79d09 Mon Sep 17 00:00:00 2001 From: Jerone Young Date: Tue, 13 Jan 2026 13:44:13 -0600 Subject: [PATCH 17/17] Add check for model type crb not supporting version 1.2 Signed-off-by: Jerone Young --- lib/fog/libvirt/models/compute/tpm.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fog/libvirt/models/compute/tpm.rb b/lib/fog/libvirt/models/compute/tpm.rb index 995810a..5b8b897 100644 --- a/lib/fog/libvirt/models/compute/tpm.rb +++ b/lib/fog/libvirt/models/compute/tpm.rb @@ -40,6 +40,7 @@ def initialize(arch = "", attributes = {}) super defaults.merge(attributes) raise Fog::Errors::Error, "#{type} is not a supported TPM type" if new? && !TYPES.include?(type) raise Fog::Errors::Error, "#{model} is not a supported TPM model" if new? && !supported_models.include?(model) + raise Fog::Errors::Error, "TPM model type crb does not a supported TPM version 1.2" if model == "crb" && version == "1.2" end def new?