From nobody Fri Dec 19 17:51:36 2025 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=1711186835; cv=none; d=zohomail.com; s=zohoarc; b=aWGHq2B1tKVML4tUhdb/blx2ZxoCVAppgXlHTDQpTAIS8QUD10E18X2ZsXAFyhK8wghWDX10cz9Wh8tzDax9jczAaXXT1GgHAcQ4oseIUG89lcyAou/WsAFClNNIZWe0swlxIpCuXETzddMB+NTVa5eHBy3QqcH5uScwznV/ywg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711186835; 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=y1fWqB6PzQvtbUUzX2u4fVzvPmI8Eyf+NSgS+zlsb+Y=; b=eUfoW+EpKiHspIW4ChgNDlhmqB/iC+k7AW11XjNLEyXzG00qoUsrwMmQFog1FtWtszB0u+tDLg31fB0Yg5dpgvGoH6OVrShXBhQAOIUVmHVIQZFRb+yif2/BtBHlgQvVviQ3/jwWSrzsPUqvNdNRXonByoKv+42CRskOX/vTdBA= 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 171118683535432.85768320668444; Sat, 23 Mar 2024 02:40:35 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnxqW-0001p8-Ms; Sat, 23 Mar 2024 05:39:24 -0400 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 1rnxqT-0001od-Os for qemu-devel@nongnu.org; Sat, 23 Mar 2024 05:39:21 -0400 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 1rnxqR-0006wt-D4 for qemu-devel@nongnu.org; Sat, 23 Mar 2024 05:39:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=t-8ch.de; s=mail; t=1711186752; bh=2JLoEvBr8ShBIMBQWSMVVUm8Hdn8BucAfAqSpnJ4aaU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=qGk4iF2sOnHSxjOUJpfkqMbP+avEYYomBCBAd/jj9BpyBDhnRWM9YdNpTJ1lNbLkO uHku3W91sTtg52k/JLVdT0jjvlCA1HWFhLY68CxDx1818vJJov37pAMVOesqjhMzDf XYIGG4AtbNDOljjK4pSKQySZqpSJl/KBlEMMFHKs= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Sat, 23 Mar 2024 10:39:10 +0100 Subject: [PATCH v7 5/7] 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: <20240323-pvpanic-shutdown-v7-5-4ac1fd546d6f@t-8ch.de> References: <20240323-pvpanic-shutdown-v7-0-4ac1fd546d6f@t-8ch.de> In-Reply-To: <20240323-pvpanic-shutdown-v7-0-4ac1fd546d6f@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.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1711186751; l=1650; i=thomas@t-8ch.de; s=20221212; h=from:subject:message-id; bh=k19zzq4mYJdN2OE0/Y1gHo14BiZIj+kA8x0gNif0H+w=; b=EfZXFDRHp7rEy6qYhqvdUMa+5OnG3Nwum5c5ETrvRogCcZ0YgnfTtdpNCDuxPVQeIEFxZ525G bhGKt3Q6iOpBbXhSU0eQcjOxpvGTmvzTHieTF0rmMq0rFFIbDzg3X9Y 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 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: 1711186837448100003 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 789fc34559ad..888a11e62011 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -455,6 +455,20 @@ { 'event': 'GUEST_CRASHLOADED', 'data': { 'action': 'GuestPanicAction', '*info': 'GuestPanicInformation'= } } =20 +## +# @GUEST_PVSHUTDOWN: +# +# Emitted when guest submits a shutdown request via pvpanic interface +# +# Since: 9.0 +# +# 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.44.0