mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 21:15:20 +00:00
virDomainDeviceBootParseXML: Use virXMLProp*
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
cea39e9529
commit
f0e1cc7083
@ -6480,22 +6480,12 @@ static int
|
|||||||
virDomainDeviceBootParseXML(xmlNodePtr node,
|
virDomainDeviceBootParseXML(xmlNodePtr node,
|
||||||
virDomainDeviceInfo *info)
|
virDomainDeviceInfo *info)
|
||||||
{
|
{
|
||||||
g_autofree char *order = NULL;
|
|
||||||
g_autofree char *loadparm = NULL;
|
g_autofree char *loadparm = NULL;
|
||||||
|
|
||||||
if (!(order = virXMLPropString(node, "order"))) {
|
if (virXMLPropUInt(node, "order", 10,
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
|
||||||
"%s", _("missing boot order attribute"));
|
&info->bootIndex) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if (virStrToLong_uip(order, NULL, 10, &info->bootIndex) < 0 ||
|
|
||||||
info->bootIndex == 0) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||||
_("incorrect boot order '%s', expecting positive integer"),
|
|
||||||
order);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
loadparm = virXMLPropString(node, "loadparm");
|
loadparm = virXMLPropString(node, "loadparm");
|
||||||
if (loadparm) {
|
if (loadparm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user