From: Tim Wiederhake Date: Wed, 21 Apr 2021 15:51:28 +0000 (+0200) Subject: virDomainDeviceDimmAddressParseXML: Use virXMLProp* X-Git-Tag: v7.3.0-rc1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d19af6243595f6a88cc829c7d2f8e2a1302d2810;p=thirdparty%2Flibvirt.git virDomainDeviceDimmAddressParseXML: Use virXMLProp* Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index aa3a109a32..aef63464f0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -6515,24 +6515,13 @@ static int virDomainDeviceDimmAddressParseXML(xmlNodePtr node, virDomainDeviceDimmAddress *addr) { - g_autofree char *tmp = NULL; - - if (!(tmp = virXMLPropString(node, "slot")) || - virStrToLong_uip(tmp, NULL, 10, &addr->slot) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid or missing dimm slot id '%s'"), - NULLSTR(tmp)); + if (virXMLPropUInt(node, "slot", 10, VIR_XML_PROP_REQUIRED, + &addr->slot) < 0) return -1; - } - VIR_FREE(tmp); - if ((tmp = virXMLPropString(node, "base"))) { - if (virStrToLong_ullp(tmp, NULL, 16, &addr->base) < 0) { - virReportError(VIR_ERR_XML_ERROR, - _("invalid dimm base address '%s'"), tmp); - return -1; - } - } + if (virXMLPropULongLong(node, "base", 16, VIR_XML_PROP_NONE, + &addr->base) < 0) + return -1; return 0; }