]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDomainIOThreadPinDefParseXML: Use virXMLProp*
authorTim Wiederhake <twiederh@redhat.com>
Tue, 4 May 2021 14:02:30 +0000 (16:02 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 6 May 2021 11:54:36 +0000 (13:54 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c

index f729de7e762f7c40e9a129c7cb9fb5e5d03ee2d8..a534aa77ad9edb1f2f8725b62a1546eab29a9ba8 100644 (file)
@@ -17135,24 +17135,10 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node,
     g_autofree char *tmp = NULL;
     g_autoptr(virBitmap) cpumask = NULL;
 
-    if (!(tmp = virXMLPropString(node, "iothread"))) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("missing iothread id in iothreadpin"));
-        return -1;
-    }
-
-    if (virStrToLong_uip(tmp, NULL, 10, &iothreadid) < 0) {
-        virReportError(VIR_ERR_XML_ERROR,
-                       _("invalid setting for iothread '%s'"), tmp);
-        return -1;
-    }
-    VIR_FREE(tmp);
-
-    if (iothreadid == 0) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("zero is an invalid iothread id value"));
+    if (virXMLPropUInt(node, "iothread", 10,
+                       VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
+                       &iothreadid) < 0)
         return -1;
-    }
 
     if (!(iothrid = virDomainIOThreadIDFind(def, iothreadid))) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,