mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
virDomainIOThreadIDDefParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
593140dabd
commit
324f6f5826
@ -18229,21 +18229,13 @@ static virDomainIOThreadIDDef *
|
|||||||
virDomainIOThreadIDDefParseXML(xmlNodePtr node)
|
virDomainIOThreadIDDefParseXML(xmlNodePtr node)
|
||||||
{
|
{
|
||||||
virDomainIOThreadIDDef *iothrid;
|
virDomainIOThreadIDDef *iothrid;
|
||||||
g_autofree char *tmp = NULL;
|
|
||||||
|
|
||||||
iothrid = g_new0(virDomainIOThreadIDDef, 1);
|
iothrid = g_new0(virDomainIOThreadIDDef, 1);
|
||||||
|
|
||||||
if (!(tmp = virXMLPropString(node, "id"))) {
|
if (virXMLPropUInt(node, "id", 10,
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
|
||||||
_("Missing 'id' attribute in <iothread> element"));
|
&iothrid->iothread_id) < 0)
|
||||||
goto error;
|
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);
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
return iothrid;
|
return iothrid;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user