From 848635bd8fc915bb2b7b9128e660cea9f20c42a5 Mon Sep 17 00:00:00 2001 Message-ID: <848635bd8fc915bb2b7b9128e660cea9f20c42a5.1725987015.git.crobinso@redhat.com> From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 20 Aug 2024 10:03:56 +0100 Subject: [PATCH virt-manager] virtinst: add properties for AMD SEV-SNP MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-type: text/plain Signed-off-by: Daniel P. Berrangé --- virtinst/cli.py | 7 ++++++- virtinst/domain/launch_security.py | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/virtinst/cli.py b/virtinst/cli.py index c4dffd34..43b5fb52 100644 --- a/virtinst/cli.py +++ b/virtinst/cli.py @@ -4805,8 +4805,13 @@ class ParserLaunchSecurity(VirtCLIParser): cls.add_arg("policy", "policy") cls.add_arg("session", "session") cls.add_arg("dhCert", "dhCert") + cls.add_arg("guestVisibleWorkarounds", "guestVisibleWorkarounds") + cls.add_arg("idBlock", "idBlock") + cls.add_arg("idAuth", "idAuth") + cls.add_arg("hostData", "hostData") cls.add_arg("kernelHashes", "kernelHashes", is_onoff=True) - + cls.add_arg("authorKey", "authorKey", is_onoff=True) + cls.add_arg("vcek", "vcek", is_onoff=True) ########################### # Public virt parser APIs # diff --git a/virtinst/domain/launch_security.py b/virtinst/domain/launch_security.py index 9d2998d9..f56527cb 100644 --- a/virtinst/domain/launch_security.py +++ b/virtinst/domain/launch_security.py @@ -16,7 +16,13 @@ class DomainLaunchSecurity(XMLBuilder): policy = XMLProperty("./policy") session = XMLProperty("./session") dhCert = XMLProperty("./dhCert") + guestVisibleWorkarounds = XMLProperty("./guestVisibleWorkarounds") + idBlock = XMLProperty("./idBlock") + idAuth = XMLProperty("./idAuth") + hostData = XMLProperty("./hostData") kernelHashes = XMLProperty("./@kernelHashes", is_yesno=True) + authorKey = XMLProperty("./@authorKey", is_yesno=True) + vcek = XMLProperty("./@vcek", is_yesno=True) def _set_defaults_sev(self, guest): if not guest.os.is_q35() or not guest.is_uefi(): @@ -32,6 +38,12 @@ class DomainLaunchSecurity(XMLBuilder): if domcaps.supports_sev_launch_security(check_es=True): self.policy = "0x07" + def _set_defaults_sev_snp(self, guest): + if not guest.os.is_q35() or not guest.is_uefi(): + raise RuntimeError(_("SEV-SNP launch security requires a Q35 UEFI machine")) + def set_defaults(self, guest): if self.type == "sev": return self._set_defaults_sev(guest) + elif self.type == "sev-snp": + return self._set_defaults_sev_snp(guest) -- 2.46.0