From nobody Mon Sep 16 19:51:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1707422585; cv=none; d=zohomail.com; s=zohoarc; b=BCkIhQof3m0he8dELqqqF+xvr1Ikfod4ITMdkj6wpkgwvcCcz8hdvIjL34VTWdOA3s6EpyK6CUIcn+LmBVGDycV72+dOi+/9Eu0MHiohF2JpUNP9W1zFMFj+tJNNw+oTOTbwanyp5/08ZFEyM0w66tiaihUr9Q2OUadV7IzO7pc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707422585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JQJY1IJdvZGcvKTvJ/GE5QYzw1Nc6KIWEspzqlUB9Zs=; b=cokxcYksxHtT+X+dMwlQ7oEvEi2zGXTHqCm6j6mPMZglMNgLREnQaK4epCYgxcF6K5lDxhZpe+cQqgaD1/8rOb2+sXzfgnf09+ruWjGOCRnqKg+4aFUXrAyVbqC1UcWBVSmtgXR5aOblq6ySF2tjYP9ToR7H9VC8Gr2dXtXnp3o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707422585458542.7165432238332; Thu, 8 Feb 2024 12:03:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYAbP-0008Sn-T8; Thu, 08 Feb 2024 15:02:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYAbO-0008S1-7v for qemu-devel@nongnu.org; Thu, 08 Feb 2024 15:02:30 -0500 Received: from todd.t-8ch.de ([159.69.126.157]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rYAbM-0001U7-8r for qemu-devel@nongnu.org; Thu, 08 Feb 2024 15:02:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1707422544; bh=pLDGQUmcOkurLoPLQFej1T/V3Bo/OA3pqVp4oxQAW5A=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=lpHkDhK02czEiVIrZdJ2gKXMFyLNSIEGdmEwpSAa9lWJmXepihTkrS4T5Tt6OCmvq R9E/A73d7mtaBvCLNvYSgDPIep7on8o/RppO3p+L81eyeF4/XPGnTdyCjUvAWD7a3e 8O3mo5ujH2Qd9LXxaUpGye3sj8KeP8WsHiZLt+N4= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Thu, 08 Feb 2024 21:02:24 +0100 Subject: [PATCH v6 5/6] pvpanic: Emit GUEST_PVSHUTDOWN QMP event on pvpanic shutdown signal MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240208-pvpanic-shutdown-v6-5-965580ac057b@t-8ch.de> References: <20240208-pvpanic-shutdown-v6-0-965580ac057b@t-8ch.de> In-Reply-To: <20240208-pvpanic-shutdown-v6-0-965580ac057b@t-8ch.de> To: "Michael S. Tsirkin" , Cornelia Huck , Paolo Bonzini , Thomas Huth , Laurent Vivier Cc: qemu-devel@nongnu.org, Alejandro Jimenez , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1707422542; l=1642; i=thomas@t-8ch.de; s=20221212; h=from:subject:message-id; bh=jDQrzFDng3hs6cePBwRlPLgJKcbRtWnG6BeDN4GONAU=; b=uLOZl52gNFXacR5e9cY073yixw9VZKwQcnNK6K/pyZ5u+kqTmfmN1q0n/ZFvR9QWa2E+YVsww CVNwV0iv5eJDOdZ+vX5CE9XN7c3O9JUqFqQiVdp7O/3H5laD3yBxPn3 X-Developer-Key: i=thomas@t-8ch.de; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=159.69.126.157; envelope-from=thomas@t-8ch.de; helo=todd.t-8ch.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @t-8ch.de) X-ZM-MESSAGEID: 1707422587666100012 From: Alejandro Jimenez Emit a QMP event on receiving a PVPANIC_SHUTDOWN event. Even though a typic= al SHUTDOWN event will be sent, it will be indistinguishable from a shutdown originating from other cases (e.g. KVM exit due to KVM_SYSTEM_EVENT_SHUTDOW= N) that also issue the guest-shutdown cause. A management layer application can detect the new GUEST_PVSHUTDOWN event to determine if the guest is using the pvpanic interface to request shutdowns. Signed-off-by: Alejandro Jimenez --- qapi/run-state.json | 14 ++++++++++++++ system/runstate.c | 1 + 2 files changed, 15 insertions(+) diff --git a/qapi/run-state.json b/qapi/run-state.json index 08bc99cb8561..d5a63e14ba7e 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -460,6 +460,20 @@ { 'event': 'GUEST_CRASHLOADED', 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation'= } } =20 +## +# @GUEST_PVSHUTDOWN: +# +# Emitted when guest submits a shutdown request via pvpanic interface +# +# Since: 8.3 +# +# Example: +# +# <- { "event": "GUEST_PVSHUTDOWN", +# "timestamp": { "seconds": 1648245259, "microseconds": 893771 } } +## +{ 'event': 'GUEST_PVSHUTDOWN' } + ## # @GuestPanicAction: # diff --git a/system/runstate.c b/system/runstate.c index 572499513034..02b0a1f8b9d0 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -574,6 +574,7 @@ void qemu_system_guest_crashloaded(GuestPanicInformatio= n *info) =20 void qemu_system_guest_pvshutdown(void) { + qapi_event_send_guest_pvshutdown(); qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } =20 --=20 2.43.0