[libvirt PATCH v6 7/8] virDomainIOThreadIDDefParseXML: Use virXMLProp*

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

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a0fb7731d9..858ef5db9d 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -18229,21 +18229,13 @@ static virDomainIOThreadIDDef *
 virDomainIOThreadIDDefParseXML(xmlNodePtr node)
 {
     virDomainIOThreadIDDef *iothrid;
-    g_autofree char *tmp = NULL;
 
     iothrid = g_new0(virDomainIOThreadIDDef, 1);
 
-    if (!(tmp = virXMLPropString(node, "id"))) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("Missing 'id' attribute in <iothread> element"));
-        goto error;
-    }
-    if (virStrToLong_uip(tmp, NULL, 10, &iothrid->iothread_id) < 0 ||
-        iothrid->iothread_id == 0) {
-        virReportError(VIR_ERR_XML_ERROR,
-                       _("invalid iothread 'id' value '%s'"), tmp);
+    if (virXMLPropUInt(node, "id", 10,
+                       VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
+                       &iothrid->iothread_id) < 0)
         goto error;
-    }
 
     return iothrid;
 
-- 
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