]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuPrepareNVRAM: Save domain after NVRAM path generation
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 25 Sep 2014 12:39:19 +0000 (14:39 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Sep 2014 08:14:34 +0000 (10:14 +0200)
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 <mprivozn@redhat.com>
src/qemu/qemu_process.c

index dddca35837eafee74ad6fd22a434172dfee10db2..1b8931ea2d92de555f79a2c631719c0742a43275 100644 (file)
@@ -3876,6 +3876,9 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg,
             goto cleanup;
 
         generated = true;
+
+        if (virDomainSaveConfig(cfg->configDir, def) < 0)
+            goto cleanup;
     }
 
     if (!virFileExists(loader->nvram)) {