From: Tim Wiederhake Date: Wed, 21 Apr 2021 12:08:06 +0000 (+0200) Subject: virDomainDeviceCcidAddressParseXML: Use virXMLProp* X-Git-Tag: v7.3.0-rc1~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f5672c54b41d936bb437ed29cf1e509d0dd4d3b;p=thirdparty%2Flibvirt.git virDomainDeviceCcidAddressParseXML: Use virXMLProp* Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 5360fb301f..dbe30b05c1 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -361,24 +361,14 @@ int virDomainDeviceCcidAddressParseXML(xmlNodePtr node, virDomainDeviceCcidAddress *addr) { - g_autofree char *controller = virXMLPropString(node, "controller"); - g_autofree char *slot = virXMLPropString(node, "slot"); - memset(addr, 0, sizeof(*addr)); - if (controller && - virStrToLong_uip(controller, NULL, 10, &addr->controller) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot parse
'controller' attribute")); + if (virXMLPropUInt(node, "controller", 10, VIR_XML_PROP_NONE, + &addr->controller) < 0) return -1; - } - if (slot && - virStrToLong_uip(slot, NULL, 10, &addr->slot) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot parse
'slot' attribute")); + if (virXMLPropUInt(node, "slot", 10, VIR_XML_PROP_NONE, &addr->slot) < 0) return -1; - } return 0; }