From eaf02ea2d6a16a503eacfcff30e3c965399e1a01 Mon Sep 17 00:00:00 2001 From: Bin Guo Date: Wed, 18 Dec 2024 15:57:57 +0800 Subject: [PATCH] support the virtCCA feature --- ...eter-into-the-type-of-LaunchSecurity.patch | 189 +++++++ ...mm-memory-info-API-into-libvirt-host.patch | 521 ++++++++++++++++++ ...daemons-depend-on-generated-protocol.patch | 91 +++ libvirt.spec | 8 +- 4 files changed, 808 insertions(+), 1 deletion(-) create mode 100644 Add-cvm-parameter-into-the-type-of-LaunchSecurity.patch create mode 100644 Add-get-tmm-memory-info-API-into-libvirt-host.patch create mode 100644 Make-daemons-depend-on-generated-protocol.patch 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 0000000..cb50af6 --- /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 ++ ++ ++ +