[PATCH v2] Log alarms should be generated even if the QEMU process is not stopped

丁丽敏 dinglimin at cmss.chinamobile.com
Mon Sep 26 09:49:41 UTC 2022







If the qemu process is shutdown and flag is set to VIR_QEMU_PROCESS_KILL_NOWAIT,

a log alarm is generated even if the qemu process is not stopped.




Signed-off-by: dinglimin <dinglimin at cmss.chinamobile.com>

---

v1:https://www.mail-archive.com/libvir-list@redhat.com/msg232232.html

diff to v1:

- Add the patch 's description.

- Change the code format.

---




 src/qemu/qemu_process.c | 8 +++++---

 1 file changed, 5 insertions(+), 3 deletions(-)




diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c

index cbfdd3bda5..d876e345a0 100644

--- a/src/qemu/qemu_process.c

+++ b/src/qemu/qemu_process.c

@@ -8006,9 +8006,11 @@ qemuProcessKill(virDomainObj *vm, unsigned int flags)

     }




     if (flags & VIR_QEMU_PROCESS_KILL_NOWAIT) {

-        virProcessKill(vm->pid,

-                       (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?

-                       SIGKILL : SIGTERM);

+        if (virProcessKill(vm->pid,

+                          (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?

+                          SIGKILL : SIGTERM);) {

+            VIR_DEBUG("Failed to terminate qemu process");

+        }

         return 0;

     }




-- 

2.18.4


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20220926/d20ad794/attachment-0001.htm>


More information about the libvir-list mailing list