[libvirt PATCH 2/6] conf: virDomainSEVDef: Change type of "sectype" to virDomainLaunchSecurity

Tim Wiederhake twiederh at redhat.com
Mon Jul 5 10:46:50 UTC 2021


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/conf/domain_conf.c | 6 ++++--
 src/conf/domain_conf.h | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index c1438d85f4..68ab18f3ab 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14722,6 +14722,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
     virDomainSEVDef *def;
     unsigned long policy;
     g_autofree char *type = NULL;
+    int sectype;
     int rc = -1;
 
     def = g_new0(virDomainSEVDef, 1);
@@ -14734,8 +14735,8 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
         goto error;
     }
 
-    def->sectype = virDomainLaunchSecurityTypeFromString(type);
-    switch ((virDomainLaunchSecurity) def->sectype) {
+    sectype = virDomainLaunchSecurityTypeFromString(type);
+    switch ((virDomainLaunchSecurity) sectype) {
     case VIR_DOMAIN_LAUNCH_SECURITY_SEV:
         break;
     case VIR_DOMAIN_LAUNCH_SECURITY_NONE:
@@ -14746,6 +14747,7 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode,
                        type);
         goto error;
     }
+    def->sectype = sectype;
 
     if (virXPathULongHex("string(./policy)", ctxt, &policy) < 0) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index a14a2090f8..c31531c93b 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2651,7 +2651,7 @@ typedef enum {
 
 
 struct _virDomainSEVDef {
-    int sectype; /* enum virDomainLaunchSecurity */
+    virDomainLaunchSecurity sectype;
     char *dh_cert;
     char *session;
     unsigned int policy;
-- 
2.31.1




More information about the libvir-list mailing list