mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-25 14:05:18 +00:00
virDomainDeviceDimmAddressParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
3d69665959
commit
d19af62435
@ -6515,24 +6515,13 @@ static int
|
|||||||
virDomainDeviceDimmAddressParseXML(xmlNodePtr node,
|
virDomainDeviceDimmAddressParseXML(xmlNodePtr node,
|
||||||
virDomainDeviceDimmAddress *addr)
|
virDomainDeviceDimmAddress *addr)
|
||||||
{
|
{
|
||||||
g_autofree char *tmp = NULL;
|
if (virXMLPropUInt(node, "slot", 10, VIR_XML_PROP_REQUIRED,
|
||||||
|
&addr->slot) < 0)
|
||||||
if (!(tmp = virXMLPropString(node, "slot")) ||
|
|
||||||
virStrToLong_uip(tmp, NULL, 10, &addr->slot) < 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("invalid or missing dimm slot id '%s'"),
|
|
||||||
NULLSTR(tmp));
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
VIR_FREE(tmp);
|
|
||||||
|
|
||||||
if ((tmp = virXMLPropString(node, "base"))) {
|
if (virXMLPropULongLong(node, "base", 16, VIR_XML_PROP_NONE,
|
||||||
if (virStrToLong_ullp(tmp, NULL, 16, &addr->base) < 0) {
|
&addr->base) < 0)
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("invalid dimm base address '%s'"), tmp);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user