[PATCH v2] qemu: save status xml after generating taint message

Kristina Hanicova posted 1 patch 2 years, 8 months ago
Failed in applying to current master (apply log)
src/qemu/qemu_domain.c | 3 +++
1 file changed, 3 insertions(+)
[PATCH v2] qemu: save status xml after generating taint message
Posted by Kristina Hanicova 2 years, 8 months ago
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>
---
 src/qemu/qemu_domain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ce55ac39c1..5e96ea84ff 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6461,7 +6461,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 qemuDomainObjTaintAndSave(virQEMUDriver *driver,
-- 
2.31.1

Re: [PATCH v2] qemu: save status xml after generating taint message
Posted by Jano Tomko 2 years, 8 months ago
On a %A in %Y, Kristina Hanicova wrote:
> 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>
> ---
>  src/qemu/qemu_domain.c | 3 +++
>  1 file changed, 3 insertions(+)
> 

Reviewed-by: Ján Tomko <jtomko@redhat.com>

I will push tomorrow.

Jano