From nobody Sat May 18 20:37:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1664185796; cv=none; d=zohomail.com; s=zohoarc; b=DBvK9J/LTwXdySHwX4RFX7lx00qWLiA0QIonIEbGJkS1bWfH8APnUQErdf5F0t+At72XNubfO0Xm2pnYtnvSFw69lS3BIUAZieIkiR2PYC37ACYxQ0NboInGvV0b1+N82e8Vl3vgiIpDUm+Nay0MvPkO4Jkk5n1c4olZF4EUesQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664185796; h=Content-Type:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=ouyDDzu2nwIJz3PlkiNvLB4wEKFgsD7HtGJ9kR72vsM=; b=O2fN1KnZ7F3Xj1+hHm9Z9ppun5pVSAFTiAtIMRHkAu6TNYM3LvXbPw/7qMzXgYd1pmXxdqq+9eH5Xj3JIhjwuaT7P2R9u2L9SjN6O02gH9Bo4E/CnEaeSfUXd2nEyBV1FnjDPtH1YVn68662LiOW7/ZPRVx5KPl/FgWLrQ9xdkw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1664185796354515.1862622112208; Mon, 26 Sep 2022 02:49:56 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-DkqSGLVqN46vqCHdKLNWXA-1; Mon, 26 Sep 2022 05:49:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BA98800B30; Mon, 26 Sep 2022 09:49:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 070BBC15BA4; Mon, 26 Sep 2022 09:49:51 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BC1F5194658D; Mon, 26 Sep 2022 09:49:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5975D1946586 for ; Mon, 26 Sep 2022 09:49:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1661E2166B29; Mon, 26 Sep 2022 09:49:49 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D9412166B26 for ; Mon, 26 Sep 2022 09:49:49 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E1AC3101A528 for ; Mon, 26 Sep 2022 09:49:48 +0000 (UTC) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by relay.mimecast.com with ESMTP id us-mta-605-Yi2A2ZpIN3iV0EEDEdCAbw-1; Mon, 26 Sep 2022 05:49:45 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.89]) by rmmx-syy-dmz-app02-12002 (RichMail) with SMTP id 2ee2633175b518e-f7f1d; Mon, 26 Sep 2022 17:49:42 +0800 (CST) Received: from LAPTOP-CDJ95CPL (unknown[223.108.79.103]) by rmsmtp-syy-appsvrnew05-12026 (RichMail) with SMTP id 2efa633175b5b9f-82077; Mon, 26 Sep 2022 17:49:42 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664185795; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=ouyDDzu2nwIJz3PlkiNvLB4wEKFgsD7HtGJ9kR72vsM=; b=UWhwSafZWF80zhkPh2UlPIj2aVhi6hvn1lC5Zlb26tyJUrojkMgot7LpdKAysx8J+/u85d OnJrlVdtbNqd9Jbl9Ogot2/vKrPBy22T3n8/e8UkMLV7QAnsTCni9PQ7/TsxD22iPRPq/I QOoJPMjdhSZvGXFuowGM+QDdw2+KNhY= X-MC-Unique: DkqSGLVqN46vqCHdKLNWXA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: Yi2A2ZpIN3iV0EEDEdCAbw-1 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2ee2633175b518e-f7f1d X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 X-RM-TRANSID: 2efa633175b5b9f-82077 MIME-Version: 1.0 x-PcFlag: 1041e503-3153-4dc3-98c2-fb24fbfcb725_5_31485 Date: 26 Sep 2022 17:49:41 +0800 From: =?utf-8?B?5LiB5Li95pWP?= To: libvir-list Cc: Subject: [PATCH v2] Log alarms should be generated even if the QEMU process is not stopped Message-ID: <20220926174941550370677@cmss.chinamobile.com> X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/Alternative; boundary="----=_001_NextPart550370677_=----" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1664185797848100001 This is a multi-part message in MIME format. ------=_001_NextPart550370677_=---- Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If the qemu process is shutdown and flag is set to VIR_QEMU_PROCESS_K= ILL_NOWAIT, a log alarm is generated even if the qemu process is not stopp= ed. Signed-off-by: dinglimin --- 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 d= eletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_proces= s.c index cbfdd3bda5..d876e345a0 100644 --- a/src/qemu/qemu_process.c ++= + b/src/qemu/qemu_process.c @@ -8006,9 +8006,11 @@ qemuProcessKill(virDoma= inObj *vm, unsigned int flags) } if (flags & VIR_QEMU_PR= OCESS_KILL_NOWAIT) { - virProcessKill(vm->pid, - = (flags & VIR_QEMU_PROCESS_KILL_FORCE) ? - S= IGKILL : 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 ------=_001_NextPart550370677_=---- Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
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 <di= nglimin@cmss.chinamobile.com>
---
v1:https://www.mail-archive.com/libvir-l= ist@redhat.com/msg232232.html
diff to v= 1:
- 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_proces= s.c
index cbfdd3bda5..d876e345a0 10064= 4
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8006,9 +8006,11 @@ qemuProcessKill(virDomainObj *v= m, unsigned int flags)
    &n= bsp;}

     if (flags & VIR_QEMU_PROCESS_KILL_NOWAIT)= {
-        virPr= ocessKill(vm->pid,
-     =                   (flags &= VIR_QEMU_PROCESS_KILL_FORCE) ?
-  = ;                     SIG= KILL : SIGTERM);
+      =  if (virProcessKill(vm->pid,
+=                     &nbs= p;    (flags & VIR_QEMU_PROCESS_KILL_FORCE) ?
+               &nb= sp;          SIGKILL : SIGTERM);) {
+            VIR_DEBUG(= "Failed to terminate qemu process");
+ =        }
  &nb= sp;      return 0;
 = ;    }

-- 
2.18.4

<= /div>
------=_001_NextPart550370677_=------