[libvirt PATCH 03/10] virDomainDeviceISAAddressParseXML: Use virXMLProp*

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

 



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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 9113993bce..b28265cf4f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6494,27 +6494,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;
 }
-- 
2.26.3




[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