diff options
author | Corey Minyard <cminyard@mvista.com> | 2015-12-17 12:50:19 -0600 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:21 -0600 |
commit | 1eefbb4e37b2a6d86c82fed01fab36b9dd740010 (patch) | |
tree | fd93307890bf22459bd7e1e495fd46374fc99715 /hw/ipmi | |
parent | 5353516786b426c5d5575a0a1ec68615c334e9dd (diff) | |
download | hqemu-1eefbb4e37b2a6d86c82fed01fab36b9dd740010.zip hqemu-1eefbb4e37b2a6d86c82fed01fab36b9dd740010.tar.gz |
ipmi: Add a force off function
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>
Diffstat (limited to 'hw/ipmi')
-rw-r--r-- | hw/ipmi/ipmi_bmc_extern.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 <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 */ @@ -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; } } |