Index: ioemu/target-i386-dm/helper2.c
===================================================================
--- ioemu.orig/target-i386-dm/helper2.c	2006-08-17 19:37:36.530505066 +0100
+++ ioemu/target-i386-dm/helper2.c	2006-08-17 19:49:40.116333768 +0100
@@ -127,6 +127,25 @@
 /* called from main_cpu_reset */
 void cpu_reset(CPUX86State *env)
 {
+    int xcHandle;
+    int sts;
+
+    /* pause domain first, to avoid repeated reboot request*/
+    xc_domain_pause(xc_handle, domid);
+
+    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)
@@ -455,6 +474,10 @@
         if (vm_running) {
             if (shutdown_requested)
                 break;
+            if (reset_requested) {
+                qemu_system_reset();
+                reset_requested = 0;
+            }
         }
 
         /* Wait up to 10 msec. */
Index: ioemu/vl.c
===================================================================
--- ioemu.orig/vl.c	2006-08-17 19:49:39.442408257 +0100
+++ ioemu/vl.c	2006-08-17 19:49:40.119333436 +0100
@@ -4948,7 +4948,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	2006-08-17 19:47:32.680418959 +0100
+++ ioemu/vl.h	2006-08-17 19:49:40.120333326 +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;
