[libvirt PATCH 09/10] virDomainDeviceUSBAddressParseXML: Use virXMLProp*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/conf/device_conf.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c
index f7bf2de6f1..1ce31e9234 100644
--- a/src/conf/device_conf.c
+++ b/src/conf/device_conf.c
@@ -403,19 +403,16 @@ 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 <address> 'bus' attribute"));
+    if (virXMLPropUInt(node, "bus", 10, VIR_XML_PROP_OPTIONAL,
+                       &addr->bus) < 0)
         return -1;
-    }
+
     return 0;
 }
 
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux