]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: save status xml after generating taint message
authorKristina Hanicova <khanicov@redhat.com>
Tue, 27 Jul 2021 12:36:00 +0000 (14:36 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 12 Aug 2021 08:34:35 +0000 (10:34 +0200)
We didn't always save status xml after generating new taint message
which resulted in it being deleted in case of a libvirtd restart.
Some taint messages were preserved thanks to saving status xml
separately at the end of the calling functions. With this, every taint
message is saved, regardless of the calling functions.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1965589

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_domain.c

index bc448e48a479b100c7a7cc23722b6504a0a8bd16..a05ebf871d6e89fbeee6cd34f0b8932fea28ade8 100644 (file)
@@ -6463,7 +6463,10 @@ void qemuDomainObjTaint(virQEMUDriver *driver,
                         virDomainTaintFlags taint,
                         qemuDomainLogContext *logCtxt)
 {
+    g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
+
     qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL);
+    ignore_value(virDomainObjSave(obj, driver->xmlopt, cfg->stateDir));
 }
 
 void qemuDomainObjTaintMsg(virQEMUDriver *driver,