mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-09-07 09:45:06 +03:00
conf: Always parse firmware features
Regardless of whether firmware autoselection is in use, we still want to parse the list of requested features. Doing this will allow us to produce better error messages. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
@@ -18439,20 +18439,6 @@ virDomainDefParseBootFirmwareOptions(virDomainDef *def,
|
|||||||
int n = 0;
|
int n = 0;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
if (!firmware)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
fw = virDomainOsDefFirmwareTypeFromString(firmware);
|
|
||||||
|
|
||||||
if (fw <= 0) {
|
|
||||||
virReportError(VIR_ERR_XML_ERROR,
|
|
||||||
_("unknown firmware value %s"),
|
|
||||||
firmware);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
def->os.firmware = fw;
|
|
||||||
|
|
||||||
if ((n = virXPathNodeSet("./os/firmware/feature", ctxt, &nodes)) < 0)
|
if ((n = virXPathNodeSet("./os/firmware/feature", ctxt, &nodes)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -18479,6 +18465,20 @@ virDomainDefParseBootFirmwareOptions(virDomainDef *def,
|
|||||||
|
|
||||||
def->os.firmwareFeatures = g_steal_pointer(&features);
|
def->os.firmwareFeatures = g_steal_pointer(&features);
|
||||||
|
|
||||||
|
if (!firmware)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
fw = virDomainOsDefFirmwareTypeFromString(firmware);
|
||||||
|
|
||||||
|
if (fw <= 0) {
|
||||||
|
virReportError(VIR_ERR_XML_ERROR,
|
||||||
|
_("unknown firmware value %s"),
|
||||||
|
firmware);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
def->os.firmware = fw;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user