Index: ioemu/target-i386-dm/helper2.c
===================================================================
--- ioemu.orig/target-i386-dm/helper2.c	2007-05-03 14:54:46.000000000 +0100
+++ ioemu/target-i386-dm/helper2.c	2007-05-03 14:55:00.000000000 +0100
@@ -127,6 +127,22 @@
 /* called from main_cpu_reset */
 void cpu_reset(CPUX86State *env)
 {
+    int xcHandle;
+    int sts;
+
+    xcHandle = xc_interface_open();
+    if (xcHandle < 0)
+        fprintf(logfile, "Cannot acquire xenctrl handle\n");
+    else {
+        sts = xc_domain_shutdown(xcHandle, domid, SHUTDOWN_reboot);
+        if (sts != 0)
+            fprintf(logfile,
+                    "? xc_domain_shutdown failed to issue reboot, sts %d\n",
+                    sts);
+        else
+            fprintf(logfile, "Issued domain %d reboot\n", domid);
+        xc_interface_close(xcHandle);
+    }
 }
 
 void cpu_x86_close(CPUX86State *env)
@@ -529,14 +545,9 @@
 
     qemu_set_fd_handler(evtchn_fd, cpu_handle_ioreq, NULL, env);
 
-    while (1) {
-        if (vm_running) {
-            if (shutdown_requested)
-                break;
-        }
-
+    while (!(vm_running && suspend_requested))
         /* Wait up to 10 msec. */
         main_loop_wait(10);
-    }
+
     return 0;
 }
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c	2007-05-03 14:55:00.000000000 +0100
+++ ioemu/vl.c	2007-05-03 14:55:00.000000000 +0100
@@ -4957,7 +4957,7 @@
 } QEMUResetEntry;
 
 static QEMUResetEntry *first_reset_entry;
-static int reset_requested;
+int reset_requested;
 int shutdown_requested;
 static int powerdown_requested;
 
Index: ioemu/vl.h
===================================================================
--- ioemu.orig/vl.h	2007-05-03 14:55:00.000000000 +0100
+++ ioemu/vl.h	2007-05-03 14:55:00.000000000 +0100
@@ -131,6 +131,7 @@
 
 void qemu_register_reset(QEMUResetHandler *func, void *opaque);
 void qemu_system_reset_request(void);
+void qemu_system_reset(void);
 void qemu_system_shutdown_request(void);
 void qemu_system_powerdown_request(void);
 #if !defined(TARGET_SPARC)
@@ -140,6 +141,8 @@
 void qemu_system_powerdown(void);
 #endif
 
+extern int reset_requested;
+
 void main_loop_wait(int timeout);
 
 extern FILE *logfile;
