[libvirt] [PATCH] qemuPrepareNVRAM: Save domain after NVRAM path generation

Martin Kletzander mkletzan at redhat.com
Thu Sep 25 17:21:28 UTC 2014


On Thu, Sep 25, 2014 at 03:00:06PM +0200, Michal Privoznik wrote:
>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

the 'is not' confused me in here.  Did you mean s/not // by any chance?

>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.
>

And if you did really mean "the updated domain definition is saved
into config dir rather than state XML only", why isn't that done when
the domain is defined (in PostParse() for example) like address
assignment, etc.?

>Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
>---
> src/qemu/qemu_process.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
>index dddca35..1b8931e 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)) {
>--
>1.8.5.5
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140925/0cc02478/attachment-0001.sig>


More information about the libvir-list mailing list