]> xenbits.xensource.com Git - libvirt.git/commitdiff
domain_capabilities: Define SGX capabilities structs
authorHaibin Huang <haibin.huang@intel.com>
Fri, 11 Nov 2022 01:21:19 +0000 (17:21 -0800)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 11 Nov 2022 13:06:21 +0000 (14:06 +0100)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_capabilities.c
src/conf/domain_capabilities.h
src/libvirt_private.syms

index a7f256e4ec054c0c3de7e1bdf109400587f48550..daeaee3c5c23401b0dfe777c2295333e6ad9c196 100644 (file)
@@ -76,6 +76,17 @@ virSEVCapabilitiesFree(virSEVCapability *cap)
 }
 
 
+void
+virSGXCapabilitiesFree(virSGXCapability *cap)
+{
+    if (!cap)
+        return;
+
+    g_free(cap->sgxSections);
+    g_free(cap);
+}
+
+
 static void
 virDomainCapsDispose(void *obj)
 {
index e0cfa755319a7f162f84336a363622aa8c6f1ea8..1d504a3506c506737ed350f168a0ed4cee470182 100644 (file)
@@ -208,6 +208,22 @@ struct _virSEVCapability {
     unsigned int max_es_guests;
 };
 
+typedef struct _virSGXSection virSGXSection;
+struct _virSGXSection {
+    unsigned long long size;
+    unsigned int node;
+};
+
+typedef struct _virSGXCapability virSGXCapability;
+struct _virSGXCapability {
+    bool flc;
+    bool sgx1;
+    bool sgx2;
+    unsigned long long section_size;
+    size_t nSgxSections;
+    virSGXSection *sgxSections;
+};
+
 typedef enum {
     VIR_DOMAIN_CAPS_FEATURE_IOTHREADS = 0,
     VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO,
@@ -246,6 +262,7 @@ struct _virDomainCaps {
 
     virDomainCapsFeatureGIC gic;
     virSEVCapability *sev;
+    virSGXCapability *sgx;
     /* add new domain features here */
 
     virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST];
@@ -296,3 +313,8 @@ void
 virSEVCapabilitiesFree(virSEVCapability *capabilities);
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSEVCapability, virSEVCapabilitiesFree);
+
+void
+virSGXCapabilitiesFree(virSGXCapability *capabilities);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSGXCapability, virSGXCapabilitiesFree);
index 97ff2a43e48a04368baa5cbcae95590d90e9da4d..ebd7bc61a8d128ba54430d55c6032c5d8d38baea 100644 (file)
@@ -218,6 +218,7 @@ virDomainCapsEnumSet;
 virDomainCapsFormat;
 virDomainCapsNew;
 virSEVCapabilitiesFree;
+virSGXCapabilitiesFree;
 
 
 # conf/domain_conf.h