OSDN Git Service

ipmi: Implement shutdown via ACPI overtemp
authorCorey Minyard <cminyard@mvista.com>
Mon, 24 Oct 2016 20:10:18 +0000 (15:10 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 1 Nov 2016 17:21:09 +0000 (19:21 +0200)
This is allowed by the IPMI specification for graceful shutdown,
so implement it.

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>
hw/ipmi/ipmi.c

index f91c7b7..5cf1caa 100644 (file)
@@ -61,9 +61,15 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op op, int checkonly)
         qmp_inject_nmi(NULL);
         return 0;
 
+    case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP:
+        if (checkonly) {
+            return 0;
+        }
+        qemu_system_powerdown_request();
+        return 0;
+
     case IPMI_POWERCYCLE_CHASSIS:
     case IPMI_PULSE_DIAG_IRQ:
-    case IPMI_SHUTDOWN_VIA_ACPI_OVERTEMP:
     case IPMI_POWERON_CHASSIS:
     default:
         return IPMI_CC_COMMAND_NOT_SUPPORTED;