mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuFirmwareFillDomain: Use FW descriptors to lookup template when resetting NVRAM
If VIR_QEMU_PROCESS_START_RESET_NVRAM flag is passed when starting a domain, then user requested to overwrite the domain specific NVRAM with the one from template. But it is very likely that the path to the template is not stored in the domain definition, which in turn makes the copy function (qemuPrepareNVRAM()) fail. The solution is simple - when preparing domain, specifically when deciding whether the path to the template should be autofilled, ignore any existing NVRAM file. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
f21166c814
commit
d192e522ef
@ -1297,6 +1297,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
|
||||
ssize_t nfirmwares = 0;
|
||||
const qemuFirmware *theone = NULL;
|
||||
bool needResult = true;
|
||||
const bool reset_nvram = flags & VIR_QEMU_PROCESS_START_RESET_NVRAM;
|
||||
size_t i;
|
||||
int ret = -1;
|
||||
|
||||
@ -1309,7 +1310,7 @@ qemuFirmwareFillDomain(virQEMUDriver *driver,
|
||||
* specified and the varstore doesn't exist ... */
|
||||
if (!virDomainDefHasOldStyleROUEFI(def) ||
|
||||
def->os.loader->templt ||
|
||||
virFileExists(def->os.loader->nvram))
|
||||
(!reset_nvram && virFileExists(def->os.loader->nvram)))
|
||||
return 0;
|
||||
|
||||
/* ... then we want to consult JSON FW descriptors first,
|
||||
|
Loading…
x
Reference in New Issue
Block a user