diff --git a/Add-cvm-parameter-into-the-type-of-LaunchSecurity.patch b/Add-cvm-parameter-into-the-type-of-LaunchSecurity.patch new file mode 100644 index 0000000000000000000000000000000000000000..cb50af6b4afd9ea62cf18bf3c0a9be977d3a8d90 --- /dev/null +++ b/Add-cvm-parameter-into-the-type-of-LaunchSecurity.patch @@ -0,0 +1,189 @@ +From b7e2bff641c87280369ed878768064c0f11e6caa Mon Sep 17 00:00:00 2001 +From: ikarosYuuki +Date: Fri, 2 Aug 2024 14:16:37 +0800 +Subject: [PATCH 1/3] Add cvm parameter into the type of LaunchSecurity which + is a optional filed for libvirt xml. Its purpose is to pass the cvm parameter + through to qemu. Also this patch support virsh edit to save cvm parameter + into libvirt temporary xml. + +--- + src/conf/domain_conf.c | 4 ++++ + src/conf/domain_conf.h | 1 + + src/conf/schemas/domaincommon.rng | 9 +++++++++ + src/qemu/qemu_command.c | 5 +++++ + src/qemu/qemu_driver.c | 8 ++++++++ + src/qemu/qemu_firmware.c | 1 + + src/qemu/qemu_namespace.c | 1 + + src/qemu/qemu_process.c | 1 + + src/qemu/qemu_validate.c | 2 ++ + 9 files changed, 32 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index dd0cb9d548..b40f924bdc 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -1514,6 +1514,7 @@ VIR_ENUM_IMPL(virDomainLaunchSecurity, + "", + "sev", + "s390-pv", ++ "cvm", + ); + + typedef enum { +@@ -3823,6 +3824,7 @@ virDomainSecDefFree(virDomainSecDef *def) + g_free(def->data.sev.session); + break; + case VIR_DOMAIN_LAUNCH_SECURITY_PV: ++ case VIR_DOMAIN_LAUNCH_SECURITY_CVM: + case VIR_DOMAIN_LAUNCH_SECURITY_NONE: + case VIR_DOMAIN_LAUNCH_SECURITY_LAST: + break; +@@ -13512,6 +13514,7 @@ virDomainSecDefParseXML(xmlNodePtr lsecNode, + return NULL; + break; + case VIR_DOMAIN_LAUNCH_SECURITY_PV: ++ case VIR_DOMAIN_LAUNCH_SECURITY_CVM: + break; + case VIR_DOMAIN_LAUNCH_SECURITY_NONE: + case VIR_DOMAIN_LAUNCH_SECURITY_LAST: +@@ -26536,6 +26539,7 @@ virDomainSecDefFormat(virBuffer *buf, virDomainSecDef *sec) + } + + case VIR_DOMAIN_LAUNCH_SECURITY_PV: ++ case VIR_DOMAIN_LAUNCH_SECURITY_CVM: + break; + + case VIR_DOMAIN_LAUNCH_SECURITY_NONE: +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index 6681eb37b4..ddbe2884db 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -2846,6 +2846,7 @@ typedef enum { + VIR_DOMAIN_LAUNCH_SECURITY_NONE, + VIR_DOMAIN_LAUNCH_SECURITY_SEV, + VIR_DOMAIN_LAUNCH_SECURITY_PV, ++ VIR_DOMAIN_LAUNCH_SECURITY_CVM, + + VIR_DOMAIN_LAUNCH_SECURITY_LAST, + } virDomainLaunchSecurity; +diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng +index b98a2ae602..f31603b2fd 100644 +--- a/src/conf/schemas/domaincommon.rng ++++ b/src/conf/schemas/domaincommon.rng +@@ -520,6 +520,9 @@ + s390-pv + + ++ ++ ++ + + + +@@ -565,6 +568,12 @@ + + + ++ ++ ++ cvm ++ ++ ++ +