* [PATCH][VT][7/15] Support rebooting VMX domains
@ 2005-08-11 19:24 Arun Sharma
0 siblings, 0 replies; only message in thread
From: Arun Sharma @ 2005-08-11 19:24 UTC (permalink / raw)
To: Ian Pratt, Keir Fraser; +Cc: xen-devel
Support rebooting VMX domains
Signed-off-by: Ke Yu <ke.yu@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
diff -r 4f2364097bd4 -r 6fb4a79e9f7a tools/ioemu/target-i386-dm/helper2.c
--- a/tools/ioemu/target-i386-dm/helper2.c Tue Aug 9 19:06:44 2005
+++ b/tools/ioemu/target-i386-dm/helper2.c Tue Aug 9 19:06:44 2005
@@ -55,6 +55,7 @@
#include "vl.h"
shared_iopage_t *shared_page = NULL;
+extern int reset_requested;
CPUX86State *cpu_86_init(void)
{
@@ -349,6 +350,10 @@
if (shutdown_requested) {
break;
}
+ if (reset_requested){
+ qemu_system_reset();
+ reset_requested = 0;
+ }
}
/* Wait up to one seconds. */
@@ -394,13 +399,26 @@
return 0;
}
+static void
+qemu_vmx_reset(void *unused)
+{
+ char cmd[255];
+ extern int domid;
+
+ /* pause domain first, to avoid repeated reboot request*/
+ xc_domain_pause (xc_handle, domid);
+
+ sprintf(cmd,"xm shutdown -R %d", domid);
+ system (cmd);
+}
+
CPUState *
cpu_init()
{
CPUX86State *env;
cpu_exec_init();
-
+ qemu_register_reset(qemu_vmx_reset, NULL);
env = malloc(sizeof(CPUX86State));
if (!env)
return NULL;
@@ -427,3 +445,4 @@
return env;
}
+
diff -r 4f2364097bd4 -r 6fb4a79e9f7a tools/ioemu/vl.c
--- a/tools/ioemu/vl.c Tue Aug 9 19:06:44 2005
+++ b/tools/ioemu/vl.c Tue Aug 9 19:06:44 2005
@@ -2030,7 +2030,7 @@
} QEMUResetEntry;
static QEMUResetEntry *first_reset_entry;
-static int reset_requested;
+int reset_requested;
int shutdown_requested;
void qemu_register_reset(QEMUResetHandler *func, void *opaque)
diff -r 4f2364097bd4 -r 6fb4a79e9f7a tools/ioemu/vl.h
--- a/tools/ioemu/vl.h Tue Aug 9 19:06:44 2005
+++ b/tools/ioemu/vl.h Tue Aug 9 19:06:44 2005
@@ -107,6 +107,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 main_loop_wait(int timeout);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-08-11 19:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-11 19:24 [PATCH][VT][7/15] Support rebooting VMX domains Arun Sharma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.