From patchwork Thu Dec 17 18:50:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 58623 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp570122lbb; Thu, 17 Dec 2015 11:28:31 -0800 (PST) X-Received: by 10.140.16.177 with SMTP id 46mr39226468qgb.16.1450380511813; Thu, 17 Dec 2015 11:28:31 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j6si12641892qgd.14.2015.12.17.11.28.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 17 Dec 2015 11:28:31 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org Received: from localhost ([::1]:56535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9eE3-0000nK-Bj for patch@linaro.org; Thu, 17 Dec 2015 14:28:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9dlz-0002wS-LD for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:59:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9dlu-00012c-LU for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:59:31 -0500 Received: from vms173017pub.verizon.net ([206.46.173.17]:58315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9dlu-00012T-FW for qemu-devel@nongnu.org; Thu, 17 Dec 2015 13:59:26 -0500 Received: from serve.minyard.net ([173.57.176.17]) by vms173017.mailsrvcs.net (Oracle Communications Messaging Server 7.0.5.32.0 64bit (built Jul 16 2014)) with ESMTPA id <0NZI00JBLNEIXHG0@vms173017.mailsrvcs.net> for qemu-devel@nongnu.org; Thu, 17 Dec 2015 12:59:06 -0600 (CST) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=btqxfxui c=1 sm=1 tr=0 a=bXmWQgKa9n63w7XTPFb8JQ==:117 a=N54-gffFAAAA:8 a=HL3alpDKAAAA:8 a=oR5dmqMzAAAA:8 a=xqWC_Br6kY4A:10 a=wUQvQvOEmiQA:10 a=fk1lIlRQAAAA:8 a=E3iNAc6TDbc_6Tm5TrkA:9 Received: from t430.minyard.net (unknown [IPv6:2001:470:b8f6:1b:53a:188f:9b92:a0a7]) by serve.minyard.net (Postfix) with ESMTPA id 94C3DA428; Thu, 17 Dec 2015 12:50:30 -0600 (CST) Received: by t430.minyard.net (Postfix, from userid 1000) id 76CA4300FF1; Thu, 17 Dec 2015 12:50:27 -0600 (CST) From: minyard@acm.org To: qemu-devel@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Date: Thu, 17 Dec 2015 12:50:19 -0600 Message-id: <1450378219-25799-17-git-send-email-minyard@acm.org> X-Mailer: git-send-email 2.5.0 In-reply-to: <1450378219-25799-1-git-send-email-minyard@acm.org> References: <1450378219-25799-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.46.173.17 X-Mailman-Approved-At: Thu, 17 Dec 2015 14:22:15 -0500 Cc: Corey Minyard Subject: [Qemu-devel] [PATCH v5 16/16] ipmi: Add a force off function X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Corey Minyard Allow the IPMI interface to request a forced power off. Signed-off-by: Corey Minyard --- hw/ipmi/ipmi_bmc_extern.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.5.0 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; } }