Index: ioemu/target-i386-dm/helper2.c
===================================================================
--- ioemu.orig/target-i386-dm/helper2.c	2006-12-08 01:26:06.000000000 +0000
+++ ioemu/target-i386-dm/helper2.c	2006-12-08 01:26:08.000000000 +0000
@@ -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)
@@ -479,6 +498,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-12-08 01:26:08.000000000 +0000
+++ ioemu/vl.c	2006-12-08 01:26:08.000000000 +0000
@@ -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-12-08 01:26:07.000000000 +0000
+++ ioemu/vl.h	2006-12-08 01:26:08.000000000 +0000
@@ -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;
