diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-08-11 21:06:15 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-08-11 21:06:15 +0000 |
commit | 065e90e43a38fa7f8b0c1ed323000956f07adb5e (patch) | |
tree | 32b06287414a300bb39c6abc9cd7aa25fad2612b | |
parent | 19b77ba87c8a00a796af44beb8781d5a5eb5f818 (diff) | |
download | xen-065e90e43a38fa7f8b0c1ed323000956f07adb5e.tar.gz xen-065e90e43a38fa7f8b0c1ed323000956f07adb5e.tar.bz2 xen-065e90e43a38fa7f8b0c1ed323000956f07adb5e.zip |
When the guest shuts down a VM, make sure that the domain gets destroyed.
Device model needs to do xm destroy before it exits on
guest shutdown/poweroff/halt -p.
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
-rw-r--r-- | tools/ioemu/monitor.c | 8 | ||||
-rw-r--r-- | tools/ioemu/target-i386-dm/helper2.c | 12 |
2 files changed, 13 insertions, 7 deletions
diff --git a/tools/ioemu/monitor.c b/tools/ioemu/monitor.c index 677f9b6d85..43304ea253 100644 --- a/tools/ioemu/monitor.c +++ b/tools/ioemu/monitor.c @@ -225,14 +225,10 @@ static void do_info_history (void) } } +extern void destroy_vmx_domain(void); static void do_quit(void) { - extern int domid; - extern FILE* logfile; - char destroy_cmd[20]; - sprintf(destroy_cmd, "xm destroy %d", domid); - if (system(destroy_cmd) == -1) - fprintf(logfile, "%s failed.!\n", destroy_cmd); + destroy_vmx_domain(); exit(0); } diff --git a/tools/ioemu/target-i386-dm/helper2.c b/tools/ioemu/target-i386-dm/helper2.c index 361a2bbe9e..5cbeb88aeb 100644 --- a/tools/ioemu/target-i386-dm/helper2.c +++ b/tools/ioemu/target-i386-dm/helper2.c @@ -328,7 +328,16 @@ do_interrupt(CPUState *env, int vector) env->send_event = 1; } -//static unsigned long tsc_per_tick = 1; /* XXX: calibrate */ +void +destroy_vmx_domain(void) +{ + extern int domid; + extern FILE* logfile; + char destroy_cmd[20]; + sprintf(destroy_cmd, "xm destroy %d", domid); + if (system(destroy_cmd) == -1) + fprintf(logfile, "%s failed.!\n", destroy_cmd); +} int main_loop(void) { @@ -396,6 +405,7 @@ int main_loop(void) } } } + destroy_vmx_domain(); return 0; } |