Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx> --- src/conf/device_conf.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 587f966398..f7bf2de6f1 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -362,24 +362,15 @@ 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 <address> 'controller' attribute")); + if (virXMLPropUInt(node, "controller", 10, VIR_XML_PROP_OPTIONAL, + &addr->controller) < 0) return -1; - } - if (slot && - virStrToLong_uip(slot, NULL, 10, &addr->slot) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot parse <address> 'slot' attribute")); + if (virXMLPropUInt(node, "slot", 10, VIR_XML_PROP_OPTIONAL, + &addr->slot) < 0) return -1; - } return 0; } -- 2.26.2