{
unsigned int format = 0;
- if (!loaderNode) {
- /* If there is no <loader> element but the <nvram> element
- * was present, copy the format from the latter to the
- * former.
- *
- * This ensures that a configuration such as
- *
- * <os>
- * <nvram format='foo'/>
- * </os>
- *
- * behaves as expected, that is, results in a firmware build
- * with format 'foo' being selected */
- if (loader->nvram)
- loader->format = loader->nvram->format;
-
+ if (!loaderNode)
return 0;
- }
if (virXMLPropTristateBool(loaderNode, "readonly", VIR_XML_PROP_NONE,
&loader->readonly) < 0)
bool autoSelection = (def->os.firmware != VIR_DOMAIN_OS_DEF_FIRMWARE_NONE);
int ret;
+ /* If there is no <loader> element but the <nvram> element
+ * was present, copy the format from the latter to the
+ * former.
+ *
+ * This ensures that a configuration such as
+ *
+ * <os>
+ * <nvram format='foo'/>
+ * </os>
+ *
+ * behaves as expected, that is, results in a firmware build
+ * with format 'foo' being selected */
+ if (loader && loader->nvram && !loader->format)
+ loader->format = loader->nvram->format;
+
/* If we're loading an existing configuration from disk, we
* should try as hard as possible to preserve historical
* behavior. In particular, firmware autoselection being enabled