From nobody Mon Feb 9 16:51:17 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1545128643653919.17837074973; Tue, 18 Dec 2018 02:24:03 -0800 (PST) Received: from localhost ([::1]:52918 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZCLs-0007Ek-TL for importer@patchew.org; Tue, 18 Dec 2018 05:11:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZCJx-00060S-I0 for qemu-devel@nongnu.org; Tue, 18 Dec 2018 05:09:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZCJu-00086R-QF for qemu-devel@nongnu.org; Tue, 18 Dec 2018 05:09:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59784) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gZCJu-0007yJ-F9 for qemu-devel@nongnu.org; Tue, 18 Dec 2018 05:09:46 -0500 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 1C4E37FD46; Tue, 18 Dec 2018 10:09:44 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-56.ams2.redhat.com [10.36.116.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EC9817B57; Tue, 18 Dec 2018 10:09:43 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 037F111385A7; Tue, 18 Dec 2018 11:09:42 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Tue, 18 Dec 2018 11:09:35 +0100 Message-Id: <20181218100941.25267-2-armbru@redhat.com> In-Reply-To: <20181218100941.25267-1-armbru@redhat.com> References: <20181218100941.25267-1-armbru@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.27]); Tue, 18 Dec 2018 10:09:44 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/7] qapi: Turn ShutdownCause into QAPI enum X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dominik Csapak Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Dominik Csapak Needed so the patch after next can add ShutdownCause to QMP events SHUTDOWN and RESET. Signed-off-by: Dominik Csapak Message-Id: <20181205110131.23049-2-d.csapak@proxmox.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- include/sysemu/sysemu.h | 20 -------------------- qapi/run-state.json | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 8d6095d98b..f83522c7e7 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -31,26 +31,6 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMC= hangeStateHandler *cb, void qemu_del_vm_change_state_handler(VMChangeStateEntry *e); void vm_state_notify(int running, RunState state); =20 -/* Enumeration of various causes for shutdown. */ -typedef enum ShutdownCause { - SHUTDOWN_CAUSE_NONE, /* No shutdown request pending */ - SHUTDOWN_CAUSE_HOST_ERROR, /* An error prevents further use of gues= t */ - SHUTDOWN_CAUSE_HOST_QMP, /* Reaction to a QMP command, like 'quit= ' */ - SHUTDOWN_CAUSE_HOST_SIGNAL, /* Reaction to a signal, such as SIGINT = */ - SHUTDOWN_CAUSE_HOST_UI, /* Reaction to UI event, like window clo= se */ - SHUTDOWN_CAUSE_GUEST_SHUTDOWN,/* Guest shutdown/suspend request, via - ACPI or other hardware-specific means= */ - SHUTDOWN_CAUSE_GUEST_RESET, /* Guest reset request, and command line - turns that into a shutdown */ - SHUTDOWN_CAUSE_GUEST_PANIC, /* Guest panicked, and command line turns - that into a shutdown */ - SHUTDOWN_CAUSE_SUBSYSTEM_RESET,/* Partial guest reset that does not tr= igger - QMP events and ignores --no-reboot. = This - is useful for sanitize hypercalls on= s390 - that are used during kexec/kdump/boo= t */ - SHUTDOWN_CAUSE__MAX, -} ShutdownCause; - static inline bool shutdown_caused_by_guest(ShutdownCause cause) { return cause >=3D SHUTDOWN_CAUSE_GUEST_SHUTDOWN; diff --git a/qapi/run-state.json b/qapi/run-state.json index 332e44897b..de7725bf09 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -59,6 +59,40 @@ 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog', 'guest-panicked', 'colo', 'preconfig' ] } =20 +## +# @ShutdownCause: +# +# An enumeration of reasons for a Shutdown. +# +# @none: No shutdown request pending +# +# @host-error: An error prevents further use of guest +# +# @host-qmp: Reaction to a QMP command, like 'quit' +# +# @host-signal: Reaction to a signal, such as SIGINT +# +# @host-ui: Reaction to a UI event, like window close +# +# @guest-shutdown: Guest shutdown/suspend request, via ACPI or other +# hardware-specific means +# +# @guest-reset: Guest reset request, and command line turns that into +# a shutdown +# +# @guest-panic: Guest panicked, and command line turns that into a shutdown +# +# @subsystem-reset: Partial guest reset that does not trigger QMP events a= nd +# ignores --no-reboot. This is useful for sanitizing +# hypercalls on s390 that are used during kexec/kdump/boot +# +## +{ 'enum': 'ShutdownCause', + # Beware, shutdown_caused_by_guest() depends on enumeration order + 'data': [ 'none', 'host-error', 'host-qmp', 'host-signal', 'host-ui', + 'guest-shutdown', 'guest-reset', 'guest-panic', + 'subsystem-reset'] } + ## # @StatusInfo: # --=20 2.17.2