]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainDeviceISAAddressParseXML: Use virXMLProp*
authorTim Wiederhake <twiederh@redhat.com>
Wed, 21 Apr 2021 13:33:25 +0000 (15:33 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 21 Apr 2021 15:11:04 +0000 (17:11 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/domain_conf.c

index 878f4896655f7f2d7be457a308464654789ed801..1f68ac4dc5c1982f534179185bb17007f0cc1f49 100644 (file)
@@ -6509,27 +6509,14 @@ static int
 virDomainDeviceISAAddressParseXML(xmlNodePtr node,
                                   virDomainDeviceISAAddress *addr)
 {
-    g_autofree char *iobase = NULL;
-    g_autofree char *irq = NULL;
-
     memset(addr, 0, sizeof(*addr));
 
-    iobase = virXMLPropString(node, "iobase");
-    irq = virXMLPropString(node, "irq");
-
-    if (iobase &&
-        virStrToLong_uip(iobase, NULL, 16, &addr->iobase) < 0) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("Cannot parse <address> 'iobase' attribute"));
+    if (virXMLPropUInt(node, "iobase", 16, VIR_XML_PROP_NONE,
+                       &addr->iobase) < 0)
         return -1;
-    }
 
-    if (irq &&
-        virStrToLong_uip(irq, NULL, 16, &addr->irq) < 0) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("Cannot parse <address> 'irq' attribute"));
+    if (virXMLPropUInt(node, "irq", 16, VIR_XML_PROP_NONE, &addr->irq) < 0)
         return -1;
-    }
 
     return 0;
 }