[PATCH 4/5] qemu: process: Append the "shutting down" message using the new APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use qemuDomainLogAppendMessage rather than attempting to open a new
logging context with file descriptors. The new approach allows to log
the message even if qemu is still running at that point which appens
during migration finish phase where qemuProcessStop is killing qemu.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1312188
---
 src/qemu/qemu_process.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 66bc4b1..84454ab 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -5605,7 +5605,6 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     size_t i;
     char *timestamp;
     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
-    qemuDomainLogContextPtr logCtxt = NULL;

     VIR_DEBUG("Shutting down vm=%p name=%s id=%d pid=%llu, "
               "reason=%s, asyncJob=%s, flags=%x",
@@ -5642,13 +5641,9 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     /* Wake up anything waiting on domain condition */
     virDomainObjBroadcast(vm);

-    if ((logCtxt = qemuDomainLogContextNew(driver, vm,
-                                           QEMU_DOMAIN_LOG_CONTEXT_MODE_STOP))) {
-        if ((timestamp = virTimeStringNow()) != NULL) {
-            qemuDomainLogContextWrite(logCtxt, "%s: shutting down\n", timestamp);
-            VIR_FREE(timestamp);
-        }
-        qemuDomainLogContextFree(logCtxt);
+    if ((timestamp = virTimeStringNow()) != NULL) {
+        qemuDomainLogAppendMessage(driver, vm, "%s: shutting down\n", timestamp);
+        VIR_FREE(timestamp);
     }

     /* Clear network bandwidth */
-- 
2.8.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]