summaryrefslogtreecommitdiff
path: root/virtinst/cli.py
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2021-11-24 16:05:16 +0000
committerCole Robinson <crobinso@redhat.com>2022-01-21 17:49:15 -0500
commiteb58c09f488b0633ed1eea012cd311e48864401e (patch)
tree5cd8cda9b16d3c0c1198feedd234a7676954a952 /virtinst/cli.py
parent7e1f886aa990ee462962b264cb412b749a23a9cb (diff)
downloadvirt-manager-master.tar.gz
virtinst/guest: enable a TPM by default if UEFI is presentmaster
The bare metal world is moving to a situation where UEFI is going to be the only supported firmware and there will be a strong expectation for TPM and SecureBoot support. With this in mind, if we're enabling UEFI on a VM, it makes sense to also provide a TPM alongside it. Since this requires swtpm to be installed we can't do this unconditionally. The forthcoming libvirt release expands the domain capabilities to report whether TPMs are supported, so we check that. The user can disable the default TPM by requesting --tpm none https://github.com/virt-manager/virt-manager/issues/310 Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'virtinst/cli.py')
-rw-r--r--virtinst/cli.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/virtinst/cli.py b/virtinst/cli.py
index 480e0b1e..681d5b87 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -4079,6 +4079,7 @@ class ParserTPM(VirtCLIParser):
cli_arg_name = "tpm"
guest_propname = "devices.tpm"
remove_first = "type"
+ stub_none = False
aliases = {
"backend.type": "type",
"backend.version": "version",
@@ -4086,6 +4087,10 @@ class ParserTPM(VirtCLIParser):
}
def _parse(self, inst):
+ if self.optstr == "none":
+ self.guest.skip_default_tpm = True
+ return
+
if (self.optdict.get("type", "").startswith("/")):
self.optdict["path"] = self.optdict.pop("type")
return super()._parse(inst)