Index: ioemu/hw/piix4acpi.c
===================================================================
--- ioemu.orig/hw/piix4acpi.c	2006-08-17 19:50:05.060576667 +0100
+++ ioemu/hw/piix4acpi.c	2006-08-17 19:50:07.563300039 +0100
@@ -45,6 +45,10 @@
 #define GBL_RLS           (1 << 2)
 #define SLP_EN            (1 << 13)
 
+/* Bits of PM1a register define here  */
+#define SLP_TYP_MASK    0x1C00
+#define SLP_VAL         0x1C00
+
 typedef struct AcpiDeviceState AcpiDeviceState;
 AcpiDeviceState *acpi_device_table;
 
@@ -190,7 +194,14 @@
     s->pm1_control = (val<<8)||(s->pm1_control);
 /*    printf("acpiPm1ControlP1_writeb \n addr %x val:%x\n", addr, val); */
 
-} 
+    // Check for power off request
+
+    if (((val & SLP_EN) != 0) &&
+        ((val & SLP_TYP_MASK) == SLP_VAL)) {
+        s->pm1_timer=0x0; //clear ACPI timer
+        qemu_system_shutdown_request();
+    }
+}
 
 static uint32_t acpiPm1ControlP1_readb(void *opaque, uint32_t addr)
 {
@@ -257,7 +268,14 @@
     s->pm1_control = val;
 /*    printf("acpiPm1Control_writew \n addr %x val:%x\n", addr, val); */
 
-} 
+    // Check for power off request
+
+    if (((val & SLP_EN) != 0) &&
+        ((val & SLP_TYP_MASK) == SLP_VAL)) {
+        qemu_system_shutdown_request();
+    }
+
+}
 
 static uint32_t acpiPm1Control_readw(void *opaque, uint32_t addr)
 {
