From nobody Tue Feb 10 03:55:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1536348618633621.0385614055646; Fri, 7 Sep 2018 12:30:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8E0993082133; Fri, 7 Sep 2018 19:30:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C625A16C00; Fri, 7 Sep 2018 19:30:15 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 62ECC181A12F; Fri, 7 Sep 2018 19:30:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w87JUB1u008858 for ; Fri, 7 Sep 2018 15:30:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6EC15B690; Fri, 7 Sep 2018 19:30:11 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF8895B68E for ; Fri, 7 Sep 2018 19:30:09 +0000 (UTC) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 334F71B69 for ; Fri, 7 Sep 2018 19:30:08 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 8DEBE401; Fri, 7 Sep 2018 15:30:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 07 Sep 2018 15:30:07 -0400 Received: from localhost.localdomain (ip5b40bfaa.dynamic.kabel-deutschland.de [91.64.191.170]) by mail.messagingengine.com (Postfix) with ESMTPA id 8499CE4122; Fri, 7 Sep 2018 15:30:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:in-reply-to:message-id:mime-version :references:references:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=/RSJwvLV8ZiImDKG29CeAsR93TcMZH9OJYTzAbJGb vc=; b=dqA0eWwtYhYO0pUgaz0m5yedMM0WdJyUxb1QfC5a8+zioPgAuYkEfe/KI 5N0dzHQxmvKglmkemKxrcaSBoqOJM3kgVM2qm+CN+nFlh3hCgnulUDX6t1YH7lUH 2rj0yiXAlv26n3E3AoxU5jsbYFKyCO0UU+1F5MjOSaxLNK7UepzxNzb96xCliNsu Bt1xhwTy4xp5/ANDkyYBoFZZtJWEDbCnXi5FyTz+FEDIpASUYH7erAPlDwcAFv0h qqWv1KKH7umZGQMPshsbxMe/b0TVBMxI/yqGnFPgPxzYmrNK1NfSKADMVFV8DyHa 0it1/kEukCbZjFN14B3te7zzRA9XQ== X-ME-Proxy: X-ME-Sender: From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= To: libvir-list@redhat.com Date: Fri, 7 Sep 2018 21:29:54 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 In-Reply-To: References: X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 212 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 07 Sep 2018 19:30:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 07 Sep 2018 19:30:08 +0000 (UTC) for IP:'64.147.123.25' DOMAIN:'wout2-smtp.messagingengine.com' HELO:'wout2-smtp.messagingengine.com' FROM:'marmarek@invisiblethingslab.com' RCPT:'' X-RedHat-Spam-Score: -0.7 (DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_LOW) 64.147.123.25 wout2-smtp.messagingengine.com 64.147.123.25 wout2-smtp.messagingengine.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 1/3] libxl: send lifecycle event on suspend X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Fri, 07 Sep 2018 19:30:17 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Signed-off-by: Marek Marczykowski-G=C3=B3recki Reviewed-by: Jim Fehlig --- src/libxl/libxl_domain.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 2ab78ac..b800bc9 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -520,6 +520,18 @@ libxlDomainShutdownThread(void *opaque) case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: goto endjob; } + } else if (xl_reason =3D=3D LIBXL_SHUTDOWN_REASON_SUSPEND) { + virDomainObjSetState(vm, VIR_DOMAIN_PMSUSPENDED, + VIR_DOMAIN_PMSUSPENDED_UNKNOWN); + + dom_event =3D virDomainEventLifecycleNewFromObj(vm, + VIR_DOMAIN_EVENT_PMSUSPENDED, + VIR_DOMAIN_EVENT_PMSUSPENDED_ME= MORY); + /* + * Similar to the xl implementation, ignore SUSPEND. Any actions = needed + * after calling libxl_domain_suspend() are handled by it's caller= s. + */ + goto endjob; } else { VIR_INFO("Unhandled shutdown_reason %d", xl_reason); goto endjob; @@ -563,7 +575,6 @@ void libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *eve= nt) { libxlDriverPrivatePtr driver =3D data; - libxl_shutdown_reason xl_reason =3D event->u.domain_shutdown.shutdown_= reason; struct libxlShutdownThreadInfo *shutdown_info =3D NULL; virThread thread; libxlDriverConfigPtr cfg; @@ -574,13 +585,6 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CO= NST libxl_event *event) } =20 /* - * Similar to the xl implementation, ignore SUSPEND. Any actions need= ed - * after calling libxl_domain_suspend() are handled by its callers. - */ - if (xl_reason =3D=3D LIBXL_SHUTDOWN_REASON_SUSPEND) - goto error; - - /* * Start a thread to handle shutdown. We don't want to be tying up * libxl's event machinery by doing a potentially lengthy shutdown. */ --=20 git-series 0.9.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list