From: Tim Wiederhake Date: Tue, 4 May 2021 14:02:30 +0000 (+0200) Subject: virDomainIOThreadPinDefParseXML: Use virXMLProp* X-Git-Tag: v7.4.0-rc1~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=124357c17add4ea3ee6c1d25706f44ccad8e3419;p=thirdparty%2Flibvirt.git virDomainIOThreadPinDefParseXML: Use virXMLProp* Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f729de7e76..a534aa77ad 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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,