From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQC5-0006st-K0 for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:53:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBQC4-0000of-Qd for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:53:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBQC4-0000ob-L8 for qemu-devel@nongnu.org; Tue, 22 Dec 2015 11:53:48 -0500 Date: Tue, 22 Dec 2015 18:53:46 +0200 From: "Michael S. Tsirkin" Message-ID: <1450803119-4223-24-git-send-email-mst@redhat.com> References: <1450803119-4223-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450803119-4223-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 23/55] ipmi: Add a force off function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Corey Minyard From: Corey Minyard Allow the IPMI interface to request a forced power off. Signed-off-by: Corey Minyard Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ipmi/ipmi_bmc_extern.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 05b9121..56073b3 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -30,6 +30,7 @@ #include #include "qemu/timer.h" #include "sysemu/char.h" +#include "sysemu/sysemu.h" #include "hw/ipmi/ipmi.h" #define VM_MSG_CHAR 0xA0 /* Marks end of message */ @@ -52,6 +53,7 @@ #define VM_CAPABILITIES_IRQ 0x04 #define VM_CAPABILITIES_NMI 0x08 #define VM_CAPABILITIES_ATTN 0x10 +#define VM_CMD_FORCEOFF 0x09 #define TYPE_IPMI_BMC_EXTERN "ipmi-bmc-extern" #define IPMI_BMC_EXTERN(obj) OBJECT_CHECK(IPMIBmcExtern, (obj), \ @@ -268,6 +270,10 @@ static void handle_hw_op(IPMIBmcExtern *ibe, unsigned char hw_op) case VM_CMD_SEND_NMI: k->do_hw_op(s, IPMI_SEND_NMI, 0); break; + + case VM_CMD_FORCEOFF: + qemu_system_shutdown_request(); + break; } } -- MST