From: Peter Krempa Date: Wed, 5 Oct 2022 13:54:39 +0000 (+0200) Subject: virDomainSEVDefParseXML: Use virXPathUIntBase instead of virXPathULongHex X-Git-Tag: v8.10.0-rc1~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=053415a649ab46d299268c6b123e2d1392b355f6;p=thirdparty%2Flibvirt.git virDomainSEVDefParseXML: Use virXPathUIntBase instead of virXPathULongHex Use the proper function for an unsigned int. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7c6caa01e5..8b1a28c0d3 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -13178,14 +13178,13 @@ static int virDomainSEVDefParseXML(virDomainSEVDef *def, xmlXPathContextPtr ctxt) { - unsigned long policy; int rc; if (virXMLPropTristateBool(ctxt->node, "kernelHashes", VIR_XML_PROP_NONE, &def->kernel_hashes) < 0) return -1; - if (virXPathULongHex("string(./policy)", ctxt, &policy) < 0) { + if (virXPathUIntBase("string(./policy)", ctxt, 16, &def->policy) < 0) { virReportError(VIR_ERR_XML_ERROR, "%s", _("failed to get launch security policy")); return -1; @@ -13214,7 +13213,6 @@ virDomainSEVDefParseXML(virDomainSEVDef *def, return -1; } - def->policy = policy; def->dh_cert = virXPathString("string(./dhCert)", ctxt); def->session = virXPathString("string(./session)", ctxt);