From patchwork Thu Nov 12 19:02:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corey Minyard X-Patchwork-Id: 56474 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp600756lbb; Thu, 12 Nov 2015 11:15:15 -0800 (PST) X-Received: by 10.129.75.131 with SMTP id y125mr18152405ywa.48.1447355713937; Thu, 12 Nov 2015 11:15:13 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t142si10463787ywf.263.2015.11.12.11.15.13 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Nov 2015 11:15:13 -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; dkim=fail header.i=@gmail.com Received: from localhost ([::1]:49329 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwxKz-0007Zy-Hy for patch@linaro.org; Thu, 12 Nov 2015 14:15:13 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwxCo-0000n8-Hj for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:06:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwxCj-0005z8-EL for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:06:46 -0500 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:34168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwxCj-0005yy-9E for qemu-devel@nongnu.org; Thu, 12 Nov 2015 14:06:41 -0500 Received: by padhx2 with SMTP id hx2so73242864pad.1 for ; Thu, 12 Nov 2015 11:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=lv3PI786MFoiUXCEBvjd2yHZi13JbwlSTOCVG+yLQLE=; b=qufrGXUcdXmbJHlXymirpDxCVlq6kjxGyCQ14Prf1hXsGTdUNvM59FKfxC94Zj/p9H E1G7Hhi5f+ZNj7gbd32XZANmnt5JfE0XOfZRML760vaL29P924tmyaV2f2gq/h9Okxja KLQALNIunq0eFnFdh+gJ7QnVRx88Dbyw81Yh/o9w6lXXnKTLxpf24aRrhaQOXNhRSSoz MF7/tY/DJgfbHAJJIf4YBHqFWowic4L9ynmBauOrxH8lSjRDS+3tFwiNfqz5PhYbsmJz k79kavz0euS0Gey628EhQHiUwBA3wSRESs9VONBoyUEE0KBrgOhmtUdDs7ymZmQ+ZTYw f51g== X-Received: by 10.66.124.135 with SMTP id mi7mr25889016pab.102.1447355200571; Thu, 12 Nov 2015 11:06:40 -0800 (PST) Received: from t430.minyard.home (pool-173-57-176-17.dllstx.fios.verizon.net. [173.57.176.17]) by smtp.gmail.com with ESMTPSA id rx10sm16154920pab.21.2015.11.12.11.06.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Nov 2015 11:06:40 -0800 (PST) Received: from t430.minyard.home (t430.minyard.home [127.0.0.1]) by t430.minyard.home (8.14.7/8.14.7) with ESMTP id tACJ2jG2019771; Thu, 12 Nov 2015 13:02:45 -0600 Received: (from cminyard@localhost) by t430.minyard.home (8.14.7/8.14.7/Submit) id tACJ2jO6019770; Thu, 12 Nov 2015 13:02:45 -0600 From: minyard@acm.org To: qemu-devel@nongnu.org, Paolo Bonzini , "Michael S. Tsirkin" , Igor Mammedov Date: Thu, 12 Nov 2015 13:02:33 -0600 Message-Id: <1447354953-18893-18-git-send-email-minyard@acm.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1447354953-18893-1-git-send-email-minyard@acm.org> References: <1447354953-18893-1-git-send-email-minyard@acm.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::235 Cc: Corey Minyard Subject: [Qemu-devel] [PATCH v4 17/17] 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 | 5 +++++ 1 file changed, 5 insertions(+) -- 1.8.3.1 diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index 05b9121..7ae6294 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -52,6 +52,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 +269,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: + exit(0); + break; } }