Skip to content

Commit

Permalink
ipmi: Add a force off function
Browse files Browse the repository at this point in the history
Allow the IPMI interface to request a forced power off.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
cminyard authored and mstsirkin committed Dec 22, 2015
1 parent 44d3db0 commit ad2a807
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/ipmi/ipmi_bmc_extern.c
Expand Up @@ -30,6 +30,7 @@
#include <stdint.h>
#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 */
Expand All @@ -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), \
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit ad2a807

Please sign in to comment.