mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-20 22:50:16 +03:00
guest: Move uefi check into _add_default_tpm
This is closer to the same pattern used by _add_default_* Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
5003f0432e
commit
b7e86d2fcc
@ -700,11 +700,7 @@ class Guest(XMLBuilder):
|
||||
self._add_default_channels()
|
||||
self._add_default_rng()
|
||||
self._add_default_memballoon()
|
||||
if self.is_uefi():
|
||||
# If the guest is using UEFI, we take that as a
|
||||
# flag that the VM is targeting a modern platform
|
||||
# and thus we should also provide an emulated TPM.
|
||||
self._add_default_tpm()
|
||||
self._add_default_tpm()
|
||||
|
||||
self.clock.set_defaults(self)
|
||||
self.cpu.set_defaults(self)
|
||||
@ -954,6 +950,12 @@ class Guest(XMLBuilder):
|
||||
if self.devices.tpm:
|
||||
return
|
||||
|
||||
# If the guest is using UEFI, we take that as a
|
||||
# flag that the VM is targeting a modern platform
|
||||
# and thus we should also provide an emulated TPM.
|
||||
if not self.is_uefi():
|
||||
return
|
||||
|
||||
if not self.lookup_domcaps().supports_tpm_emulator():
|
||||
log.debug("Domain caps doesn't report TPM support")
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user