From d09a191f6295015fa20a068f1dcc3a4c73181732 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 5 Jul 2021 12:46:50 +0200 Subject: [PATCH] conf: virDomainSEVDef: Change type of "sectype" to virDomainLaunchSecurity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tim Wiederhake Reviewed-by: Ján Tomko Signed-off-by: Ján Tomko --- 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;