Add Trusted Platform Module (TPM) support#185
Open
rhjyoung wants to merge 17 commits intofog:masterfrom
Open
Conversation
Signed-off-by: Jerone Young jyoung@redhat.com
There was an unneeded space in the conditional. Signed-off-by: Jerone Young <jyoung@redhat.com>
Fix designation of ARM architecture and add ppc64le. Signed-off-by: Jerone Young <jyoung@redhat.com
Add s390x support Signed-off-by: Jerone Young <jyoung@redhat.com>
ekohl
reviewed
Jan 12, 2026
Contributor
ekohl
left a comment
There was a problem hiding this comment.
These are just my first impressions. Haven't done actual testing on it.
Contributor
There was a problem hiding this comment.
I'd normally keep the options at the end and even consider the following
Suggested change
| def initialize(attributes = {}, arch = "") | |
| def initialize(arch, **attributes) |
Contributor
Author
There was a problem hiding this comment.
Can definitely move the order. But using **attributes breaks with the convention used in network.rb. Also Trying to change to ** attributes breaks the code.
Fix conditional & change argument order when creating new TPM object Signed-off-by: Jerone Young <jyoung@redhat.com>
Fix argument initialization order and fix error calls Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com> Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
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 <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Signed-off-by: Jerone Young <jyoung@redhat.com>
Contributor
Author
|
Created code for Foreman: |
ekohl
reviewed
Jan 17, 2026
Contributor
ekohl
left a comment
There was a problem hiding this comment.
Code looks good to me. A quick test in tests/libvirt/models/compute/server_tests.rb tells me it works. I used this test:
test("with tpm set to true") do
server = Fog::Libvirt::Compute::Server.new(
{
:tpm => true,
:nics => [],
:volumes => []
}
)
xml = server.to_xml
xml.include?('<tpm model="tpm-crb">') && xml.include?('<backend type="emulator" version="2.0"/>')
endThen get the following XML:
<tpm model="tpm-crb">
<backend type="emulator" version="2.0"/>
</tpm>Is this what you'd expect?
Contributor
Author
|
Yeap for x86_64 that is the expected result. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add Trusted Platform Module (TPM) support
Signed-off-by: Jerone Young jyoung@redhat.com