From: Tim Wiederhake Date: Wed, 21 Apr 2021 12:08:07 +0000 (+0200) Subject: virDomainDeviceUSBAddressParseXML: Use virXMLProp* X-Git-Tag: v7.3.0-rc1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f7cb1d243e2445571fcdf27953fcf983ab523bf;p=thirdparty%2Flibvirt.git virDomainDeviceUSBAddressParseXML: 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 dbe30b05c1..9b0b81b2cb 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -401,19 +401,15 @@ virDomainDeviceUSBAddressParseXML(xmlNodePtr node, virDomainDeviceUSBAddress *addr) { g_autofree char *port = virXMLPropString(node, "port"); - g_autofree char *bus = virXMLPropString(node, "bus"); memset(addr, 0, sizeof(*addr)); if (port && virDomainDeviceUSBAddressParsePort(addr, port) < 0) return -1; - if (bus && - virStrToLong_uip(bus, NULL, 10, &addr->bus) < 0) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Cannot parse
'bus' attribute")); + if (virXMLPropUInt(node, "bus", 10, VIR_XML_PROP_NONE, &addr->bus) < 0) return -1; - } + return 0; }