From: Michal Privoznik Date: Thu, 25 Sep 2014 12:39:19 +0000 (+0200) Subject: qemuPrepareNVRAM: Save domain after NVRAM path generation X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3a3c3780b478ccf137b434754c7c6b1ddbdf1ac2;p=libvirt.git qemuPrepareNVRAM: Save domain after NVRAM path generation On a domain startup, the variable store path is generated if needed. The path is intended to be generated only once. However, the updated domain definition is not saved into config dir rather than state XML only. So later, whenever the domain is destroyed and the daemon is restarted, the generated path is forgotten and the file may be left behind on virDomainUndefine() call. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index dddca35837..1b8931ea2d 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3876,6 +3876,9 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, goto cleanup; generated = true; + + if (virDomainSaveConfig(cfg->configDir, def) < 0) + goto cleanup; } if (!virFileExists(loader->nvram)) {