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

dinglimin posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220916022014.1424-1-dinglimin@cmss.chinamobile.com
There is a newer version of this series
src/qemu/qemu_process.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
[PATCH] Log alarms should be generated even if the QEMU process is not stopped
Posted by dinglimin 1 year, 7 months ago
Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
---
 src/qemu/qemu_process.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index cbfdd3bda5..e025e10873 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,
+        if (virProcessKill(vm->pid,
                        (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
-                       SIGKILL : SIGTERM);
+                       SIGKILL : SIGTERM) != 0) {
+	    VIR_DEBUG("Failed to terminate qemu process");
+	}
         return 0;
     }
 
-- 
2.30.0.windows.2
Re: [PATCH] Log alarms should be generated even if the QEMU process is not stopped
Posted by Peter Krempa 1 year, 7 months ago
On Fri, Sep 16, 2022 at 10:20:14 +0800, dinglimin wrote:

Please don't write all of your patch's description into the summary line
and also make sure to follow the established formatting we have for
almost all patches.

Also describe when you ran into the problem if possible.

> Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
> ---
>  src/qemu/qemu_process.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index cbfdd3bda5..e025e10873 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,
> +        if (virProcessKill(vm->pid,
>                         (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
> -                       SIGKILL : SIGTERM);
> +                       SIGKILL : SIGTERM) != 0) {
> +	    VIR_DEBUG("Failed to terminate qemu process");
> +	}

Please make sure to follow the formatting of existing code. You've added
indentation but didn't fix the rest of the function parameters and the
VIR_DEBUG statement is also totally mis-indented.

>          return 0;
>      }
>  
> -- 
> 2.30.0.windows.2
> 
> 
>